6 Answers, 1 is accepted
0
Hello Omlac,
The Text value of the RadTextBox control with the ReadOnly property set to true is sent to the server when a postback occurs, but the server does no processing for a read-only text box. This prevents a malicious user from changing a Text value that is read-only. The value of the Text property is preserved in the view state between postbacks unless modified by server-side code.
Greetings,
Plamen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
The Text value of the RadTextBox control with the ReadOnly property set to true is sent to the server when a postback occurs, but the server does no processing for a read-only text box. This prevents a malicious user from changing a Text value that is read-only. The value of the Text property is preserved in the view state between postbacks unless modified by server-side code.
Greetings,
Plamen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Omlac
Top achievements
Rank 1
answered on 24 Nov 2008, 06:16 AM
Thank you very much for your response,
Does that mean i cant use a readonly Textbox when i want to keep the value displayed, suprisingly though i have another textbox on the same form whick keeps its value even after postback.
Regards
Does that mean i cant use a readonly Textbox when i want to keep the value displayed, suprisingly though i have another textbox on the same form whick keeps its value even after postback.
Regards
1
Accepted
Hello Omlac,
As explained in this help article you cannot change the Text value of the RadInput control when its ReadOnly property is set to "true". In short, if you intend to modify the value of the control you should not use ReadOnly. If you want to be able to change the Text value (via client or server code) and at the same time prevent the user from doing so, you can use the Enabled="false" property. I hope this helps.
Best wishes,
Plamen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
As explained in this help article you cannot change the Text value of the RadInput control when its ReadOnly property is set to "true". In short, if you intend to modify the value of the control you should not use ReadOnly. If you want to be able to change the Text value (via client or server code) and at the same time prevent the user from doing so, you can use the Enabled="false" property. I hope this helps.
Best wishes,
Plamen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Ubirajara
Top achievements
Rank 1
answered on 10 Nov 2011, 08:01 PM
Hi, Im mexican, i had the same problem, the solution is..
add in the event Page_Load in the codebehind file
protected void Page_Load(object sender, EventArgs e)
{
textboxId.Attributes.Add("readonly", "true");
}
that works funny
add in the event Page_Load in the codebehind file
protected void Page_Load(object sender, EventArgs e)
{
textboxId.Attributes.Add("readonly", "true");
}
that works funny
0
Francis
Top achievements
Rank 1
answered on 14 Jun 2012, 02:26 PM
Hi, I have almost the same problem.
I have a RadTextBox control with Enabled="false". I change his value in Javascript. Then a PostBack occurs (after a change in a cutom AutoComplete control), the original value is displayed in the TextBox.
I have PageLoad event, but all the code is in a if(!IsPostBack) test...
Any idea ?
PS: version 2012.1.411.40
I have a RadTextBox control with Enabled="false". I change his value in Javascript. Then a PostBack occurs (after a change in a cutom AutoComplete control), the original value is displayed in the TextBox.
I have PageLoad event, but all the code is in a if(!IsPostBack) test...
Any idea ?
PS: version 2012.1.411.40
0
Hello Francis,
When RadTextBox is disabled (Enabled="false") the text can not be changed client side by the user. Even if you change it using JavaScript or editing the DOM using some developer tools, the changes will not reflect to server side values.
Regards,
Vasil
the Telerik team
When RadTextBox is disabled (Enabled="false") the text can not be changed client side by the user. Even if you change it using JavaScript or editing the DOM using some developer tools, the changes will not reflect to server side values.
Regards,
Vasil
the Telerik team
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.