473,466 Members | 1,430 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

UpdatePanel control loses ViewState data if Visible property setOptions

I am just starting to use AJAX, and I've run into a problem that I
cannot resolve. I have a text box, the third of three controls in an
UpdatePanel. Here's the scenario:

1. I create all the controls within the Init process.
2. Within the Load process I do FindControls on all the controls in
the page.
3. If not IsPostBack, I load data into the controls from the
database.
4. Finally, also within Load, I set the visibility of various controls
based on the requirements of the application.

The particular TextBox that I am having problems with gets a date
loaded from the database by default, but it is made Visible only if a
certain value is selected in the neighboring DropDownList, the second
control in the same UpdatePanel. This DropDownList is AutoPostBack and
triggered.

The problem is that, when the DropDownList changes to the value that
should make the TextBox Visible, the ViewState data is not entered in
the TextBox if, and only if, the following line (which runs within the
Load process) is uncommented in the code:

txtSecurityDepositDueDate.Visible =
(ddlSecurityDepositDueOn.SelectedValue.Trim() == "DO") ? true : false;

If this line is commented, the TextBox has the proper content from
ViewState; but if it runs, the TextBox is empty.

Anyone? Anyone?
Oct 7 '08 #1
0 1414

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

Similar topics

5
by: Robert Phillips | last post by:
I have a Panel control containing a few TextBox controls. The Panel is originally enabled, I enter data into the TextBox controls. When I submit, the Panel is disabled during the PostBack and the...
2
by: fabrice | last post by:
Hi, I have a trouble with my TextBox Control and it's ViewState in my form... The property for it, is FALSE as following : <form id="frmSearchBre4" runat="Server"> <asp:textbox id="myID"...
2
by: Mike | last post by:
Hi, I am strugling with a simple problem which I can't seem to resolve. I have an asp.net page which contains a server-control (flytreeview, which is a kind of a tree to be exact). The tree is...
0
by: bminder | last post by:
I have a web user control that contains a serializable class. I persist this class in viewstate, but on postback, the viewstate is null. Is this behavior by design? This technique works fine on...
6
by: AG | last post by:
I have a gridview with a template column containing an imagebutton to delete the row. Under some condition I don't want the row to be deleted, so would like to remove the button. In the...
1
by: jjwhite01 | last post by:
I am working on a web form that contains a Calendar control with an image button that makes the calendar appear and disappear. However, I would like to set the visible property of the Calendar...
2
by: ChrisCicc | last post by:
Hi All, I got a real doozy here. I have read hundreds upon hundreds of forum posts and found numerous others who have replicated this problem, but have yet to find a solution. Through testing I have...
5
by: rsdev | last post by:
Hi Guys, I can't get to the bottom of this one. I have a formview in an updatepanel and I switch between ReadOnly and Edit mode. No problem the first time round but when I try on the second go...
1
by: mohaaron | last post by:
Can anyone tell me how to get a nested UpdatePanel to update when the trigger control is in the parent UpdatePanel and I don't want to parent to update? I'm trying to change the Visible property of...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.