Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > textbox ignores disabled viewstate?

Reply
Thread Tools

textbox ignores disabled viewstate?

 
 
PJ6
Guest
Posts: n/a
 
      12-02-2005
I have a textbox control where OnKeyPress of Enter, a few hidden field
values are set and then form[0] is submitted from JavaScript. The page
reloads, and this textbox is then repopulated with data that may be
different than what the user just entered. Well, I'm having a problem with
this textbox getting its value set after the page Load event to the text the
user just entered - even when I've explicitly disabled ViewState! I found a
way around this by changing the ID of the TextBox every time the page loads
using a GUID... but is this really necessary? I must have missed something -
there must be a way of preventing the browser from blithely ignoring my
request not to record viewstate, right?

Paul


 
Reply With Quote
 
 
 
 
Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a
 
      12-02-2005
The textbox doesn't use ViewState to store its value. Instead its a simple
post in for Form collection.
Try setting the text property to a value of your choice in the Render event.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net


"PJ6" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have a textbox control where OnKeyPress of Enter, a few hidden field
>values are set and then form[0] is submitted from JavaScript. The page
>reloads, and this textbox is then repopulated with data that may be
>different than what the user just entered. Well, I'm having a problem with
>this textbox getting its value set after the page Load event to the text
>the user just entered - even when I've explicitly disabled ViewState! I
>found a way around this by changing the ID of the TextBox every time the
>page loads using a GUID... but is this really necessary? I must have missed
>something - there must be a way of preventing the browser from blithely
>ignoring my request not to record viewstate, right?
>
> Paul
>



 
Reply With Quote
 
 
 
 
PJ6
Guest
Posts: n/a
 
      12-02-2005
I had set AutoPostBack = False, too. Guess that doesn't matter though.

I think I'll override the Text property and just prevent it from being set.
I'll just have to remember not to try to set it the normal way in my own
code.

Thanks,
Paul

"Steve C. Orr [MVP, MCSD]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> The textbox doesn't use ViewState to store its value. Instead its a
> simple post in for Form collection.
> Try setting the text property to a value of your choice in the Render
> event.
>
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://SteveOrr.net
>
>
> "PJ6" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>I have a textbox control where OnKeyPress of Enter, a few hidden field
>>values are set and then form[0] is submitted from JavaScript. The page
>>reloads, and this textbox is then repopulated with data that may be
>>different than what the user just entered. Well, I'm having a problem with
>>this textbox getting its value set after the page Load event to the text
>>the user just entered - even when I've explicitly disabled ViewState! I
>>found a way around this by changing the ID of the TextBox every time the
>>page loads using a GUID... but is this really necessary? I must have
>>missed something - there must be a way of preventing the browser from
>>blithely ignoring my request not to record viewstate, right?
>>
>> Paul
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
leave button disabled if textbox has a whitespace hal ASP .Net 1 05-21-2008 07:23 AM
Disabled TextBox =?Utf-8?B?VG90eSBTYW50YW5h?= ASP .Net 1 09-27-2006 06:31 AM
TextBox - no value if disabled? matt@mailinator.com ASP .Net 4 07-28-2006 03:04 PM
Disabled textbox is nothing on postback :o( M O J O ASP .Net Building Controls 4 07-08-2006 11:34 PM
Disabled copy paste in TExtBox =?Utf-8?B?QW5kcsOpcyBPcnTDrXo=?= ASP .Net 1 06-09-2005 01:53 AM



Advertisments