I updated my telerik controls for one of my .net vb.net projects to version 2009.2.826.20 and now it seems the force postback for a button within a grid template column within an ajaxified radGrid is no longer doing the regular postback. I was previously using a pretty old version, that involved including a dll like RadGrid.Net2.dll. Anyway, below is my code that previously worked with the older version. When I updated the controls, I also went through and re-added the ScriptManager (on Master Page) and the radAjaxManager and the radGrid to the page and reset its settings, after I brought in the new telerik controls DLL. With the new version, the controls within the grid that are supposed to run ajaxified are working fine. But now it seems when I click the button, it does an ajax postback, instead of the regular postback I am trying to force. If I add an EnableAjax="false" to the radAjaxManger, everything runs without error, but obviously now it no longer does ajax postbacks for other controls within the grid that I want to use Ajax.
Code to add the postback call to the button within the grid
and in my web.config:
viewing the html source (had to set EnableAjax=false to even see this within the source html) for the button that should do a normal postback looks like:
<input type="button" name="ctl00$ContentPlaceHolder1$rdgResults$ctl00$ctl04$btnEdit" value="" onclick="realPostBack('ctl00$ContentPlaceHolder1$rdgResults$ctl00$ctl04$btnEdit', ''); return false;WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ContentPlaceHolder1$rdgResults$ctl00$ctl04$btnEdit", "", true, "", "", false, true))" id="ctl00_ContentPlaceHolder1_rdgResults_ctl00_ctl04_btnEdit" class="btnEdit" />
Is there something that has changed, regarding forcing postbacks with the newest version of the radGrid?
| <script type="text/javascript"> |
| function realPostBack(eventTarget, eventArgument) |
| { |
| __doPostBack(eventTarget, eventArgument); |
| } |
| </script> |
| <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="AjaxLoadingPanel1"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="rdgResults"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="rdgResults" LoadingPanelID="AjaxLoadingPanel1" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManager> |
| <asp:panel id="pnlsearch" runat="server" DefaultButton="btnSearch"> |
| ... |
| <telerik:RadGrid ID="rdgResults" runat="server" AllowPaging="True" AllowSorting="True" EnableEmbeddedSkins="False" Skin="radGridSkin" Width="100%" EnableOutsideScripts="True" GridLines="None"> |
| <MasterTableView AutoGenerateColumns="False" AllowNaturalSort="False" NoMasterRecordsText="No Special Permission Requests Found." |
| PageSize="20" DataKeyNames="RequestID" BorderColor="#B5E9AD"> |
| ... |
| <Columns> |
| ... |
| <telerik:GridTemplateColumn UniqueName="tmpEditColumn"> |
| <HeaderTemplate> |
| Edit |
| </HeaderTemplate> |
| <ItemTemplate> |
| <div class="functionButtons"> |
| <asp:Button runat="server" Text="" CssClass="btnEdit" ID="btnEdit" CommandName="EditCustom" /> |
| </div> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| </Columns> |
| </MasterTableView> |
| </telerik:RadGrid> |
| <asp:panel id="pnlReqEntry" runat="server"> |
Code to add the postback call to the button within the grid
| Protected Sub rdgResults_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles rdgResults.ItemCreated |
| If (TypeOf e.Item Is GridDataItem) Then |
| Dim dataItem As GridDataItem = CType(e.Item, GridDataItem) |
| Dim button1 As Button = CType(dataItem("tmpEditColumn").FindControl("btnEdit"), Button) |
| button1.Attributes.Add("onclick", String.Format("realPostBack('{0}', '{1}'); return false;", button1.UniqueID, button1.CommandArgument)) |
| End If |
| End Sub |
and in my web.config:
| <compilation debug="true"> |
| <assemblies> |
| <add assembly="Telerik.Web.Design, Version=2009.2.826.20, Culture=neutral, PublicKeyToken=121FAE78165BA3D4" /> |
| <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> |
| </assemblies> |
| </compilation> |
| <httpHandlers> |
| <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Version=2009.2.826.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" verb="*" validate="false" /> |
| </httpHandlers> |
| </system.web> |
| <system.webServer> |
| <validation validateIntegratedModeConfiguration="false" /> |
| <handlers> |
| <add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" /> |
| </handlers> |
viewing the html source (had to set EnableAjax=false to even see this within the source html) for the button that should do a normal postback looks like:
<input type="button" name="ctl00$ContentPlaceHolder1$rdgResults$ctl00$ctl04$btnEdit" value="" onclick="realPostBack('ctl00$ContentPlaceHolder1$rdgResults$ctl00$ctl04$btnEdit', ''); return false;WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ContentPlaceHolder1$rdgResults$ctl00$ctl04$btnEdit", "", true, "", "", false, true))" id="ctl00_ContentPlaceHolder1_rdgResults_ctl00_ctl04_btnEdit" class="btnEdit" />
Is there something that has changed, regarding forcing postbacks with the newest version of the radGrid?