Hi Telerik Team, I have this webpart:
protected override void CreateChildControls()
{
ScriptManager scriptManager = ScriptManager.GetCurrent(this.Page);
if (scriptManager == null)
{
scriptManager = new RadScriptManager();
this.Page.Form.Controls.AddAt(0, scriptManager);
}
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
Panel panel = new Panel();
panel.ID = "Panel1";
this.Controls.Add(panel);
RadButton button = new RadButton();
button.Height = 20;
button.Width = 100;
button.Text = "Click to update";
button.ID = "ConfigureButton";
button.OnClientClicked = "configureGauge";
button.AutoPostBack = false;
panel.Controls.Add(button);
radNumTextBox = new RadNumericTextBox();
radNumTextBox.Height = 20;
radNumTextBox.Width = 100;
radNumTextBox.ID = "NewValueNumericBox";
radNumTextBox.AllowOutOfRangeAutoCorrect = true;
panel.Controls.Add(radNumTextBox);
script = new Literal();
script.ID = "scriptLiteral";
script.Text = "<script type=\"text/javascript\">";
script.Text += "function configureGauge() {";
script.Text += "var value = $find('<%=NewValueNumericBox.ClientID %>');";
script.Text += "alert(value); }";
script.Text += "</script>";
this.Controls.Add(script);
}
When the configureGauge() function is called it returns null.
Do you know why this is happening?
Thanks,
Gustavo
protected override void CreateChildControls()
{
ScriptManager scriptManager = ScriptManager.GetCurrent(this.Page);
if (scriptManager == null)
{
scriptManager = new RadScriptManager();
this.Page.Form.Controls.AddAt(0, scriptManager);
}
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
Panel panel = new Panel();
panel.ID = "Panel1";
this.Controls.Add(panel);
RadButton button = new RadButton();
button.Height = 20;
button.Width = 100;
button.Text = "Click to update";
button.ID = "ConfigureButton";
button.OnClientClicked = "configureGauge";
button.AutoPostBack = false;
panel.Controls.Add(button);
radNumTextBox = new RadNumericTextBox();
radNumTextBox.Height = 20;
radNumTextBox.Width = 100;
radNumTextBox.ID = "NewValueNumericBox";
radNumTextBox.AllowOutOfRangeAutoCorrect = true;
panel.Controls.Add(radNumTextBox);
script = new Literal();
script.ID = "scriptLiteral";
script.Text = "<script type=\"text/javascript\">";
script.Text += "function configureGauge() {";
script.Text += "var value = $find('<%=NewValueNumericBox.ClientID %>');";
script.Text += "alert(value); }";
script.Text += "</script>";
this.Controls.Add(script);
}
When the configureGauge() function is called it returns null.
Do you know why this is happening?
Thanks,
Gustavo