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
Post a Comment