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

[Solved] The values returned from radwindow lost on page postback

5 Answers 199 Views
Window
This is a migrated thread and some comments may be shown as answers.
newbie
Top achievements
Rank 1
newbie asked on 27 May 2008, 11:31 PM
I have a usercontrol that opens a radwindow on buttonclick.
The RadWindow returns some values to be populated on the controls on the UserControl page.

On a page postback however the values populated in the controls are lost.
 Why is this happening?

5 Answers, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 28 May 2008, 03:18 PM
Hi newbie,

Since I do not have your code I am not able to reproduce the problem - I do not know your settings, the way you return values, etc.

I think that it will be best to open a new support ticket and send a small, reproduction project which includes all needed files along with a detailed explanation of the desired behavior. Once I receive it I will do my best to help.

Kind regards,
Svetlina
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
newbie
Top achievements
Rank 1
answered on 28 May 2008, 05:08 PM
I am trying to populate a HiddenField, A Readonly TextBox and a Hyperlink Control with the returned values.
I created a test project .
The Readonly Textbox and the Hyperlink controls do not retain the value on a postback such as a tabclick.
If I do not declare my textbox as readonly the textbox holds the value else the textbox loses the value too.


Please help.
0
newbie
Top achievements
Rank 1
answered on 28 May 2008, 06:45 PM
I did some reading and with ASP.NET 2.0 implementation <asp:TextBox> control if marked with its ReadOnly property as true, would ignore client side changes and would lose the same across postback.
A workaround for that is to add 
TextBox1.Attributes.Add("readonly", "readonly");
to the page_Load.
Now the TextBox works fine but the Hyperlink does not.

I am still having issues with the Hyperlink control.
Any help would be appreciated.
0
Tervel
Telerik team
answered on 29 May 2008, 08:39 AM
Hi,

This issue is not related to the RadWindow control. As you write in your message, you are able to successfully open the window, return values and set those values to the elements on the page.

The problem is related to the functioning of the ASP.NET framework, or rather because of the way HTTP protocol functions. When a page is postbacked, only the values of FORM elements (e.g. elements such as textbox, textarea, button value, etc) are submitted to the server. This means that any client-side changes made to any [other] HTML elements, such as links, divs, tables etc will not be sent to the server.

The solution of your problem is to add a hidden field for each hyperlink that you modify. When you modify the hyperlink on the client, you should also set the new value into the hidden field. On the server you should read the value, and reflect the change to the <asp:HyperLink> control.

Best regards,
Tervel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
newbie
Top achievements
Rank 1
answered on 29 May 2008, 04:44 PM
Thanks for the reply.
I understand that the problem is not related to Telerik controls and i appreciate the response. Adding a hidden field works fine.
Tags
Window
Asked by
newbie
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
newbie
Top achievements
Rank 1
Tervel
Telerik team
Share this question
or