asp LinkButton in RadAjax

3 posts, 0 answers
  1. HAN MING
    HAN MING avatar
    5 posts
    Member since:
    Sep 2016

    Posted 07 Oct 2016 Link to this post

    <telerik:RadAjaxLoadingPanel ID = "rdAjaxLoadingPanel" runat="server">
    </telerik:RadAjaxLoadingPanel>
     
    <telerik:RadAjaxPanel ID = "rdAjaxPanel" runat="server" LoadingPanelID="rdAjaxLoadingPanel" EnablePageHeadUpdate="false">
     
        <telerik:RadNotification RenderMode = "Lightweight" ID="rdNotification" runat="server" Position="Center"
            Width="330" Height="160" Animation="Fade" EnableRoundedCorners="true" EnableShadow="true" Style="z-index: 100000">
        </telerik:RadNotification>
     
        <telerik:RadTabStrip RenderMode = "Lightweight" runat="server" ID="rdTpEvents" MultiPageID="rdmlPage" SelectedIndex="0" Skin="Silk" OnTabClick="tabClick">
            <Tabs>
                 
            </Tabs>
        </telerik:RadTabStrip>
     
     
        <telerik:RadMultiPage runat = "server" ID="rdmlPage" SelectedIndex="0" CssClass="outerMultiPage">
     
            <telerik:RadPageView runat = "server" ID="rdPgLatest">
                <div class="dwp-clear">
                      
                </div>
     
                <asp:DataList ID = "LatestEvents" runat="server" RepeatDirection="Vertical" Width="100%" OnItemCommand="LatestEvents_ItemCommand" DataKeyField="id"
                    OnItemDataBound="LatestEvents_ItemDataBound">
                    <ItemTemplate>
         
                            <div class="row">
                                <div class="col-md-12">
                                          <div class="text-center register" id="dvRgisterNow" runat="server">
                                               <asp:LinkButton ID = "lnkRegisterNow" runat="server" CommandName="RegisterNow" Text="Register Now"></asp:LinkButton>
                                                   
                                           </div>
                                      </div>
                                </div>
         
                    </ItemTemplate>
               
                </asp:DataList>
     
            </telerik:RadPageView>
     
        
        </telerik:RadMultiPage>
     
    </telerik:RadAjaxPanel>

     

     

    Hi, 

    I have a asp LinkButton in RadAjaxPanel. The LinkButton initial text is "Register" and after a event happen it will change to "Unregister". After going to another pages and click on Browsers back button, the LinkButton text is "Register" and not "Unregister". This happen in IE but for Chrome and Mozilla it retain "Unregister" because of viewstate.

    Please advise.

    Thank you

     

     

     

     

  2. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    2466 posts

    Posted 11 Oct 2016 Link to this post

    Hi Han,

    Please refer to the following helps topics for this particular behavior:
    Hope this helps.


    Regards,
    Konstantin Dikov
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. Pistle
    Pistle avatar
    20 posts
    Member since:
    Sep 2020

    Posted 30 Sep Link to this post

    You can't reference the link buttons in the grid like that, anything inside the grid is more or less unreachable by server side code and server controls.
    What you CAN do is extract your button functionality to hidden buttons outside the grid, and click them using JavaScript calls initiated by your grid link buttons. I don't have your code to work with so this will be pseudo code.
    //grid template <RadTemplateColumn> <asp:LinkButton ID="LinkButton1" onclick="myFunction1(); return false;" /> </RadTemplateColumn> //javascript<script>function myFunction1(){ $("#hdnButton1").click(); } </script>//hidden button<telerik:RadButton style="display:none;" ID="hdnButton1" ClientIDMode="Static" OnClick="ServerMethod1" />//ajax settings referencing hidden button now<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" ><AjaxSettings><telerik:AjaxSetting AjaxControlID="hdnButton1"><UpdatedControls><telerik:AjaxUpdatedControl ControlID="Panel1" /></UpdatedControls></telerik:AjaxSetting></AjaxSettings></telerik:RadAjaxManager>
Back to Top