Re: 1.1 vs 2.0 Textbox Control Text on Postback
- From: "Mark Rae [MVP]" <mark@xxxxxxxxxxxxxxxxx>
- Date: Fri, 28 Dec 2007 14:12:14 -0000
"John Walker" <JohnWalker@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:ABC86370-171F-4F8B-86E0-44861D078EC3@xxxxxxxxxxxxxxxx
Did something change in 2.0 so that readonly text does not postback?
Yes:
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=102065
is there a way to get around it?
Yes.
Instead of this:
<asp:TextBox ID="MyTextBox" runat="server" ReadOnly="True" />
do this:
<asp:TextBox ID="MyTextBox" runat="server" />
and in your code behind do this:
protected void Page_Load(object sender, EventArgs e)
{
MyTextBox.Attributes.Add("readonly", "readonly");
}
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
.
- Follow-Ups:
- Re: 1.1 vs 2.0 Textbox Control Text on Postback
- From: John Walker
- Re: 1.1 vs 2.0 Textbox Control Text on Postback
- Prev by Date: Re: Disable submit button once it is clicked.
- Next by Date: Re: Adding click event to linkbutton
- Previous by thread: web.config conflicts in virtual directories
- Next by thread: Re: 1.1 vs 2.0 Textbox Control Text on Postback
- Index(es):