Hi all,
This does not work when I call this from my server side code.
I get an error :'null is null or not an object.'
It seems that the documentation rarely mentions how to reference jscript from server side code and there are not enough examples to demonstrate this.
According to your documents I used:
var button = $find("<%= RadbuttonID.ClientID %>");
My code from the server is called onindexchanged of my combobox:
My javascript and ASPX code is:
I can get the first alert in my jscript to fire but not the second one. Any ideas? I have this script in my code in my RadScriptBlock.
Thanks
This does not work when I call this from my server side code.
I get an error :'null is null or not an object.'
It seems that the documentation rarely mentions how to reference jscript from server side code and there are not enough examples to demonstrate this.
According to your documents I used:
var button = $find("<%= RadbuttonID.ClientID %>");
My code from the server is called onindexchanged of my combobox:
public
void
RadComboBox4_SelectedIndexChanged(
object
sender, RadComboBoxSelectedIndexChangedEventArgs e)
{
ScriptManager.RegisterStartupScript(
this
,
this
.GetType(),
"fireClientEvent"
,
"changeButtonState()"
,
true
);
}
My javascript and ASPX code is:
function
changeButtonState()
{
//alert('test popup');
var
button = $find(
"<%= btnSelectDeal.ClientID %>"
);
alert(button.get_text());
}
<
telerik:RadButton
runat
=
"server"
Text
=
"Select"
ID
=
"btnSelectDeal"
UseSubmitBehavior
=
"False"
Skin
=
"Telerik"
OnClick
=
"btnSelectDeal_Click"
onclientclicked
=
"OnClientClicked"
>
</
telerik:RadButton
>
I can get the first alert in my jscript to fire but not the second one. Any ideas? I have this script in my code in my RadScriptBlock.
Thanks