This is a migrated thread and some comments may be shown as answers.

asp LinkButton in RadAjax

2 Answers 106 Views
WebParts for SharePoint
This is a migrated thread and some comments may be shown as answers.
HAN MING
Top achievements
Rank 1
HAN MING asked on 07 Oct 2016, 08:04 AM
<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 Answers, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 11 Oct 2016, 02:53 PM
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.
0
Pistle
Top achievements
Rank 1
Veteran
answered on 30 Sep 2020, 10:25 AM
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>
Tags
WebParts for SharePoint
Asked by
HAN MING
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Pistle
Top achievements
Rank 1
Veteran
Share this question
or