RadTextBox Clears on Postback while ASP Textbox Doesn't

4 posts, 0 answers
  1. Wilco Rogers
    Wilco Rogers avatar
    3 posts
    Member since:
    May 2013

    Posted 28 May 2013 Link to this post

    Hello,

    I've come across a strange issue I can't seem to get my head around:

    I currently have a Dynamic TabStrip/MultiPageView setup going, which dynamically load controls as tabs are added. I have been replacing the regular ASP TextBox controls with RadTextBox controls, however I have noticed that upon changing tabs back and forth, all information in the RadTextBox controls are erased, while the ASP TextBox controls all stay filled in. I'm curious as to what the difference with the TextBoxes are that might be causing this.

    It's a little tricky to get workable code to reproduce this, but from what I can tell changes are lost on any postbacks (placing a RadTextBox outside my tabstrip to test also causes information to be lost)

    While I would normally assume this is all due to my lack of understanding of ASP page cycles, the fact that I get the expected behavior with an ASP box but not with a RAD box is confusing. Any help in the right direction or even what I can do to try and isolate the problem would be greatly appreciated.

    Thank you.

    EDIT:

    I've narrowed this down to find that Loading a control seems to break the persistence (although it doesn't seem to matter whether the text boxes are in the control our outside the tabstrip completely - the same thing happens). My understanding is that the ViewState/Postback shouldn't affect text boxes (and they don't affect the regular ones) as per this article here. So on the loading of a control, what's destroying the changes in the RadTextBox, but not destroying the changes in the ASP TextBox?
  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 31 May 2013 Link to this post

    Hello,

    If I understand correctly your scenario, you have TextBox controls in Tabs of a TabStrip control. After PostBack the value entered by the user is not persisted if you have a RadTextBox.

    I tried to reproduce the behavior you describe, but to no avail.You would find attached a sample project illustrating the scenario. TabStrip with multiple tabs and in every tab there is an Asp TextBox and a RadTextBox control. Tab2 contains a WebUserControl. The last tab is generated in the Code-Behnid. Note that you should generate the controls in the tab at latest on Page_Init(). After PostBack the values in all textboxes are persisted.

    If I have misunderstood your case, tell me what I am getting wrong. Also could you modify the attached project in a way that it replicates the behavior you describe and share it so we could further investigate the issue.

    Regards,
    Victor Tachev
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Eric
    Eric avatar
    17 posts
    Member since:
    Aug 2011

    Posted 25 Sep 2013 Link to this post

    You must have a postback event in the Tabstrip for the error to occur.
    Add  AutoPostBack="true"  to your RadTabStrip and then any value's entered in the RadTextBox will no longer persist.
    Please note, this ONLY occurs in Internet Explorer, not in Chrome and not in compatibility mode.  those work correctly.



  5. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 26 Sep 2013 Link to this post

    Hello Eric,

    This issue is already fixed, get the latest beta or internal build to test your page.

    Regards,
    Vasil
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top