hi all,
i have a problem with jquery..
i need to make controls disabled based on some conditions..
that i have done using jquery and cssclass..
but the problem is that those disabled controls gets enabled when postback occurs..
i have tried registering the script at pageload pageload complete events...but for the first time function is being called but if postback occurs that javascript function not gets called...plz help me if i am doing anything wrong..
here is my javascript function..
function DisableControls() {
debugger;
$("form :input").attr("disabled", "disabled");
var $ControlsToEnabled = $(':input.EnableConrols');
var count = 0;
var length = $ControlsToEnabled.length;
while (count < length) {
var Control = $ControlsToEnabled[count];
Control.disabled = false;
count++;
}
}
.cs file
public partial class RmsViewWorkSheetDetails : securedPage
{
protected void Page_Load(object sender, EventArgs e)
{
ClientScript.RegisterStartupScript(Page.GetType(), "OnLoad", "DisableControls();", true);
this.LoadComplete += new System.EventHandler(this.Page_LoadComplete);
}
new private void Page_LoadComplete(object sender, System.EventArgs e)
{
base.Page_LoadComplete(sender, e);
ClientScript.RegisterStartupScript(Page.GetType(), "OnLoad", "DisableControls();", true);
}
}
after postback DisableControls() function not gets fired...
plz help me ....
thanks ....