Hi,
Can someone please tell me why I got the a javascript error when I click the "Refresh using ajaxPanel.ajaxRequest()" button the second time?
Thank you,
Vincent
Javascript Error:
Sys.ArgumentException: Value must not be null for Controls and Behaviors. Parameter name: element
Here are my codes:
WebForm1.aspx
UserControl1.ascx:
UserControl1.ascx.cs
Can someone please tell me why I got the a javascript error when I click the "Refresh using ajaxPanel.ajaxRequest()" button the second time?
Thank you,
Vincent
Javascript Error:
Sys.ArgumentException: Value must not be null for Controls and Behaviors. Parameter name: element
Here are my codes:
WebForm1.aspx
| <asp:ScriptManager runat="server" ID="scriptMgr" /> |
| <uc1:UserControl1 ID="UserControl1" runat="server" /> |
| <br /> |
| <asp:Button runat="server" ID="btnRefreshAjaxManager" Text="Refresh AjaxManager" /> |
| <telerik:RadAjaxManager runat="server" ID="ajaxMgr"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="btnRefreshAjaxManager"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="UserControl1"/> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManager> |
UserControl1.ascx:
| <script language="javascript"> |
| function Refresh( controlId ) |
| { |
| var panel = $find(controlId ); |
| panel.ajaxRequest(); |
| } |
| </script> |
| <telerik:RadAjaxPanel runat="server" ID="ajaxPanel" > |
| <asp:TextBox runat="server" ID="TextBox1" /> |
| <asp:Label runat="server" ID="Label1" /> |
| <br /> |
| <asp:Button runat="server" ID="btnRefreshAjaxPanel" Text="Refresh AjaxPanel" /> |
| </telerik:RadAjaxPanel> |
| <br /> |
| <asp:Button runat="server" ID="btnRefreshJS" Text="Refresh using ajaxPanel.ajaxRequest()" /> |
UserControl1.ascx.cs
| protected void Page_Load(object sender, EventArgs e) |
| { |
| TextBox1.Text = DateTime.Now.ToString(); |
| thisthis.Label1.Text = this.ajaxPanel.ClientID; |
| this.btnRefreshJS.OnClientClick = string.Format( "Refresh( '{0}' ); return false;", ajaxPanel.ClientID); |
| } |