473,394 Members | 1,640 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

persisting viewstate for disabled webcontrols

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.
Jul 22 '05 #1
1 1638
Update: I've tried control.setAttribute("readonly","readonly");
For some reason this doesn't work. Anybody have any ideas?

"David Anderson" wrote:
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.

Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Tomas Vera | last post by:
Here's another goofy thing. I need to persist the state of items added dynamically to a Panel control between round-trips to the server. I have a web form that contains a TreeView and a...
3
by: Steve Drake | last post by:
All, I have a CONTROL that contains 1 control (Control ONE), the 1 control that it can contain 1 or 2 control (Control A and B). Control A, raises and event and Control ONE receives this event...
2
by: Jay Walker | last post by:
I created a custom DataGridColumn based on Marcie Robillard's MSDN Article: Creating Custom Columns for the ASP.NET Datagrid...
1
by: lim | last post by:
What is the possible error that occurs when the Page_load event is not triggered during execution. In my page there's some basic server control. Is there any loops holes?
5
by: Leo J. Hart IV | last post by:
Hello, I'm hoping someone can help me out. I was wondering if the Enabled property of a CheckBox or RadioButton server control is stored in the ViewState. If not, is there some way to to add...
1
by: olduncleamos | last post by:
Hello all, I am experimenting with the repeater control and ran into something that I wasn't expecting. I would appreciate if the experts can confirm or correct my understanding. Here is a...
4
by: Sven Jacobs | last post by:
Hello everybody! Imagine a form with several TextBox WebControls and two buttons "New" which should clear the form and "Save". On reloading or leaving the page which holds the form the TextBoxes...
9
by: Jamie | last post by:
I am receiving an Invalid ViewState error after posting back to the same page twice. Consistently the error occurs after the second postback and not after the first. I have looked into creating...
1
by: David Anderson | last post by:
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.