Hi there,
I am trying to add a few buttons on my page
Here is code behind of Page_Load event:
(default.aspx.cs)
Also in code behind i have the AjaxRequest event handler. This handler updates contents of the RadAjaxPanel1. Running this simple project produce the following code in HTML(please, pay attention to the third argument, it's a _asyncPostBackControlIDs collection of the PageRequestManager):
It's obvious that on the current page only 'spb0' control is 'ajaxified'.
Clicking on the LinkButton 'spb0' will proof that statement.
Clicking on the other LinkButtons will generate default postbacks.
Trying to make a little trick with the PageRequestManager i put this code in my default.aspx(at the very end of this file):
This code will force all LinkButtons to generate Ajax requests, but unfortunately in code behind only first control 'spb0' generate true AjaxRequest event and return real content of RadAjaxPanel1. All other requests generates no content.
Tracing down all responses i found the following statement in response body:
So, only the first control created in code behind is able to generate ajax requests...
Simple web project with a controls added to the default page from the toolbox works fine....
Please show where i'm wrong?
I am trying to add a few buttons on my page
Here is code behind of Page_Load event:
(default.aspx.cs)
| for (int i = 0; i < totalPages; i++) |
| { |
| LinkButton b = new LinkButton(); |
| b.Text = // never mind |
| b.CssClass = //never mind |
| b.ID = "spb" + i; |
| Panel1.Controls.Add(b); |
| RadAjaxManager1.AjaxSettings.AddAjaxSetting(b, RadAjaxPanel1, RadAjaxLoadingPanel1); |
| } |
| Sys.WebForms.PageRequestManager.getInstance()._updateControls['tRadAjaxPanel1Panel','tRadAjaxManager1SU'], ['spb0'], [], 90) |
Clicking on the LinkButton 'spb0' will proof that statement.
Clicking on the other LinkButtons will generate default postbacks.
Trying to make a little trick with the PageRequestManager i put this code in my default.aspx(at the very end of this file):
| <script type="text/javascript"> |
| Sys.WebForms.PageRequestManager.getInstance()._updateControls(['tRadAjaxPanel1Panel','tRadAjaxManager1SU'], ['spb0','spb1',...,'spbx'], [], 90); |
| </script> |
Tracing down all responses i found the following statement in response body:
| asyncPostBackControlIDs||spb0| |
Simple web project with a controls added to the default page from the toolbox works fine....
Please show where i'm wrong?