Re: Getting viewstate value from readonly textbox in .NET2 (VB)
- From: "ShaneFowlkes" <shanefowlkes@xxxxxxxxxxxxxxxxx>
- Date: Wed, 12 Apr 2006 13:51:44 -0400
Last post! =)
On second thought, I'll just use a CompareValidator to ensure the valid
date.
"ShaneFowlkes" <shanefowlkes@xxxxxxxxxxxxxxxxx> wrote in message
news:OZGybflXGHA.4920@xxxxxxxxxxxxxxxxxxxxxxx
OK...after doing much reading (and confusion), I just decided to leave the
fields wide open. My datepicker served two purposes. 1- For convenience.
2 - Making sure the date was valid date. I'll just have to an additional
server-side edit to make sure the dates are legit. I'm still a little
disappointed in this change...but I guess it's better for security issues.
: /
"ShaneFowlkes" <shanefowlkes@xxxxxxxxxxxxxxxxx> wrote in message
news:OTV$PGkXGHA.1220@xxxxxxxxxxxxxxxxxxxxxxx
Thanks for your research. I'll look into it shortly and post my results
back to this thread.
Thanks!
"Mike" <michael.lang@xxxxxxxxxxxx> wrote in message
news:1144853290.234591.326120@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I found out why it was done. I take back my "terrible idea" comment.
It was to prevent security hacks. A read-only field typically should
not be changed by the user, and thus should not be needed on postback.
Of coarse, your property is not REALLY read-only from a business
perspective, you just want them to use the date-picker. Following are
some workarounds.
"Four Guys" say to use the disabled attribute, and use ASP.NET 2.0's
SubmitDisabledControls property to enable them just before postback.
They don't like the enabled attribute since it isn't on all controls.
http://aspnet.4guysfromrolla.com/articles/012506-1.aspx
"Scott" says you shouldn't read readonly fields and instead reread them
from the database. Good for some data like id's, but not good for your
date picker solution. I recommend others reading this post do not use
the other workarounds that Rick is using for id fields used on
postback. That defeats the purpose of the security fix.
http://scottonwriting.net/sowblog/posts/4965.aspx
"Rick" says to get the read-only value from a field using the request:
this.TextBox1.Text = Request[this.TextBox1.UniqueID];
west-wind.com/weblog/posts/3939.aspx
site was down for me. If it is at the time you read this, see the
google cached version:
http://72.14.203.104/search?q=cache:tiDSEaZK0lEJ:west-wind.com/weblog/posts/3939.aspx+asp.net+2.0+textbox+readonly&hl=en&gl=us&ct=clnk&cd=1
Michael Lang
XQuiSoft LLC
http://www.xquisoft.com/
.
- References:
- Getting viewstate value from readonly textbox in .NET2 (VB)
- From: ShaneFowlkes
- Re: Getting viewstate value from readonly textbox in .NET2 (VB)
- From: Mike
- Re: Getting viewstate value from readonly textbox in .NET2 (VB)
- From: Mike
- Re: Getting viewstate value from readonly textbox in .NET2 (VB)
- From: ShaneFowlkes
- Re: Getting viewstate value from readonly textbox in .NET2 (VB)
- From: ShaneFowlkes
- Getting viewstate value from readonly textbox in .NET2 (VB)
- Prev by Date: Re: Getting viewstate value from readonly textbox in .NET2 (VB)
- Next by Date: Re: Caching (?) problem with System.Web.UI.WebControls.Table ???
- Previous by thread: Re: Getting viewstate value from readonly textbox in .NET2 (VB)
- Next by thread: Re: Getting viewstate value from readonly textbox in .NET2 (VB)
- Index(es):
Relevant Pages
|