persisting viewstate for disabled webcontrols

G

Guest

I'm having trouble persisting viewstate information for webcontrols I've
disabled via javascript. I have a group of textboxes that I enable/disable
via a checkbox control that invokes a javascript method in its onclick
attribute. When the page does a postsback, the textboxes that are enabled
have their viewstate persisted; however, the ones that are disabled (but
still have text in them) do not have their viewstate persisted. I have
perused Scott Mitchell's articles about viewstate in asp .net pages, and
according to him, controls that are disabled should have a persistant
viewstate (as long as they're not in a disabled div tag). Long story short,
I've tried many things to get this to work including trying to use the
readonly property instead of enabled/disabled, but I can't get it to work
with javascript. I'm trying to minimize the number of postbacks this webapp
will make, so using javascript is essential.
 
G

Guest

Update: I've tried control.setAttribute("readonly","readonly");
For some reason this doesn't work. Anybody have any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top