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

RadTextBox Clears on Postback while ASP Textbox Doesn't

3 Answers 269 Views
Input
This is a migrated thread and some comments may be shown as answers.
Wilco Rogers
Top achievements
Rank 1
Wilco Rogers asked on 28 May 2013, 09:15 PM
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?

3 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 31 May 2013, 03:05 PM
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.
0
Eric
Top achievements
Rank 1
answered on 25 Sep 2013, 12:44 PM
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.



0
Vasil
Telerik team
answered on 26 Sep 2013, 07:12 AM
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.
Tags
Input
Asked by
Wilco Rogers
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Eric
Top achievements
Rank 1
Vasil
Telerik team
Share this question
or