Java Script not working with UpdatPanel

Sample : on some database 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)

Note :- Instead of page for UIControl {i.e Page Control} use Updatepanel 

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)