Alert Box within UpdatePanel

Problem is Java Script doesn't work in Update Panel
Sample : On SQL condition div has to be disable and enable

To Disable
Dim strScript As String
strScript = "$('#divVI').attr('disabled', 'disabled');"

ScriptManager.RegisterStartupScript(UpdatePanel8,UpdatePanel8.GetType(), Guid.NewGuid().ToString(), "<script type='text/javascript'>" & strScript & "
</script>", False)

Note : This code is placed in page load. This will disable the div

To Enable
ScriptManager.RegisterStartupScript(UpdatePanel8, UpdatePanel8.GetType(), Guid.NewGuid().ToString(), "
<script type='text/javascript'> $('#divVI').removeAttr('disabled');</script>", False)


ScriptManager.RegisterStartupScript(UpdatePanel3, UpdatePanel3.GetType(), "DeleteMessage", "<script type='text/javascript'> alert('Individual Member Not Found!'); </script>", False)

Note :- Instead of page object use UIControl {i.e Use UpdatePanel instead of Page)

Comments

Popular posts from this blog

Shared / Static Class in vb.net/C#

Xamarin Forms : PopUp Page with RG.Plugins.Popup

Text was truncated or one or more characters had no match in the target code page.". (SQL Server Import and Export Wizard)