Reputation: 37
First time for any web dev, so this might be a really silly question because I don't know something very basic.
This JQuery disables all the input controls in the PanlDL panel:
$('#PanlDL *').attr('disabled', true);
This JQuery will find those disabled controls:
var NumDisabled = $('#PanlDL :disabled');
However, when I run this code in the form's LoadComplete event (which seems like the same thing) the 2nd JQuery above doesn't find the controls as disabled:
ScriptManager.RegisterStartupScript(Page, Page.GetType, "DiablTestKey", "$('#PanlDL *').attr('disabled', true);", True)
I've tried using Page.ClientScript.RegisterStartupScript and also an Ajax Update Panel but they both have the same result. Similarly this line of code doesn't find the someCtrl as being disabled if that control was disabled in the code behind using the ScriptManager line above:
var isDisabld = $(someCtrl).is('[disabled]');
What is the difference between running the Javascript from code behind? Does it have something to do with the "key" parameter used in the ScriptManager call?
Thanks for any help, Ken
Upvotes: 1
Views: 52