Hi! I'm running into an issue when adding a JavaScript method to the 'OnClientClicked' of a RadButton. I receive a JavaScript error "this._postbacksettings is null" and the button click event handler in the code behind never fires.
There is no validation on the aspx page, and the button is contained within a RadPane. The button has even been Ajaxed to see if that would resolve the error, but did not make a difference.
Essentially I'm trying to disable the button and change it's text once a user clicks on it so they cannot click more than once while the 'click' event handler for the button in the code behind is completing.
Here is the JavaScript code and the aspx for the button:
I have similar logic working on another page without any problem. Though on the other page there is validation and in the Javascript I have an 'If' clause that checks if the page is valid before disabling the button and changing it's text.
Could someone help me understand why this is happening, and what I may need to do to fix the JavaScript error?
Thanks!
There is no validation on the aspx page, and the button is contained within a RadPane. The button has even been Ajaxed to see if that would resolve the error, but did not make a difference.
Essentially I'm trying to disable the button and change it's text once a user clicks on it so they cannot click more than once while the 'click' event handler for the button in the code behind is completing.
Here is the JavaScript code and the aspx for the button:
function DisableSubmitBtn() {
btnSubmit = $find('<% =btnItemSubmit.ClientId %>');
btnSubmit.set_text("Submitting");
btnSubmit.set_enabled(false);
}
<
telerik:RadButton
ID
=
"btnItemSubmit"
runat
=
"server"
Skin
=
"Sunset"
Text
=
"Submit"
Width
=
"98%"
OnClientClicked
=
"DisableSubmitBtn"
>
<
Icon
PrimaryIconCssClass
=
"rbOk"
PrimaryIconLeft
=
"4"
PrimaryIconTop
=
"4"
/>
</
telerik:RadButton
>
I have similar logic working on another page without any problem. Though on the other page there is validation and in the Javascript I have an 'If' clause that checks if the page is valid before disabling the button and changing it's text.
Could someone help me understand why this is happening, and what I may need to do to fix the JavaScript error?
Thanks!