Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > PanelBar > UserControl disappear after postback

Not answered UserControl disappear after postback

Feed from this thread
  • Danny avatar

    Posted on Feb 2, 2012 (permalink)

    Hi,

    I'm having a problem with a UserControl inside a RadPanelBar. The PanelBar is nested inside an UpdatePanel (although it reacts the same if I remove it).

    <telerik:RadPanelBar runat="server" ID="pnlBar" Width="100%" ExpandMode="SingleExpandedItem" OnClientLoad="PanelBarLoad">
            <Items>
              <%--Panel::Member--%>
              <telerik:RadPanelItem>
                <HeaderTemplate>
                  Member </HeaderTemplate>
                <ContentTemplate>
                  <asp:LinkButton runat="server" CommandName="_memberClicked" OnCommand="ShowReport_Command">
                    <h1>
                      <asp:Literal ID="litMemberName" Text="" runat="server" />
                    </h1>
                  </asp:LinkButton>
                  <cc:LinkButton ID="myTest" runat="server" IgnorePermission="true" CommandName="_memberClicked" OnCommand="ShowReport_Command">
                      $ <asp:Literal ID="litMemberRevenue"  Text="" runat="server" />
                  </cc:LinkButton>
                </ContentTemplate>
              </telerik:RadPanelItem>
    ....

    After a PostBack, the default ASP:LinkButton is still visible, the custom control LinkButton disappears. 

    My custom LinkButton is a simple as the following:
      [ToolboxData("<{0}:LinkButton runat=\"server\"></{0}:LinkButton>")]
      public class LinkButton: System.Web.UI.WebControls.LinkButton {
        private bool _ShowLoadingMessage = true;
        public bool ShowLoadingMessage {
          get { return _ShowLoadingMessage; }
          set { _ShowLoadingMessage = value; }
        }
     
        protected override void OnPreRender(EventArgs e) {
          base.OnPreRender(e);
     
          //add loading client click, only if not added before
          if (ShowLoadingMessage) {
            if (!this.OnClientClick.Contains("mn_ShowLoadingMessage();")) {
              this.OnClientClick = this.OnClientClick.Insert(0, "mn_ShowLoadingMessage();");
            }
          }
        }
      }

    Any ideas?

    Thanks

    Reply

  • Peter Peter admin's avatar

    Posted on Feb 8, 2012 (permalink)

    Hello Danny,

    We couldn't replicate the issue with the information you provided. Please, open a support ticket and send us a simple demo of the problem.

    Kind regards,
    Peter
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

    Reply

  • Danny avatar

    Posted on Feb 9, 2012 (permalink)

    Hi Peter,

    I've just tried to reproduce the issue in a new, empty webproject. Unfortunately, it works just fine in here. So I'm guessing I'm doing something wrong. Last week I changed the custom LinkButton to the normal LinkButton so that I could work normally with it. I've just changed back to the custom LinkButton, and it doesn't disappear anymore...

    I have absolutely know idea what I've changed and why it's working correctly now..

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > PanelBar > UserControl disappear after postback
Related resources for "UserControl disappear after postback"

[  ASP.NET PanelBar Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  |  Step-by-step Tutorial  ]