UserControl disappear after postback

3 posts, 0 answers
  1. Danny
    Danny avatar
    29 posts
    Member since:
    Feb 2012

    Posted 02 Feb 2012 Link to this post


    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">
                  Member </HeaderTemplate>
                  <asp:LinkButton runat="server" CommandName="_memberClicked" OnCommand="ShowReport_Command">
                      <asp:Literal ID="litMemberName" Text="" runat="server" />
                  <cc:LinkButton ID="myTest" runat="server" IgnorePermission="true" CommandName="_memberClicked" OnCommand="ShowReport_Command">
                      $ <asp:Literal ID="litMemberRevenue"  Text="" runat="server" />

    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) {
          //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?

  2. Peter
    Peter avatar
    6637 posts

    Posted 08 Feb 2012 Link to this post

    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,
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. DevCraft R3 2016 release webinar banner
  4. Danny
    Danny avatar
    29 posts
    Member since:
    Feb 2012

    Posted 09 Feb 2012 Link to this post

    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..
Back to Top