473,399 Members | 3,888 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,399 software developers and data experts.

Dropdownlist State??

Is there a better way in .NET to preserve the state of say, a dropdown list
other than using hidden fields and the like? I've noticed that the method
"SelectedIndexChanged" of a dropdown list is only called when "Autopostback"
is true. This seems to defeat the purpose altogether.

When I change the value in a dropdown listbox, I want to know what the
ORIGINAL value was so that I can PRESERVE that value when the page is
re-rendered. As it stands, I don't see any method that is fired BEFORE
postback that would allow me to store the original value of the listbox.

Do I just go back to good old fashioned javascript?
Nov 16 '05 #1
2 1153
Curt Emich wrote:
Is there a better way in .NET to preserve the state of say, a dropdown
list
other than using hidden fields and the like? I've noticed that the
method "SelectedIndexChanged" of a dropdown list is only called when
"Autopostback"
is true. This seems to defeat the purpose altogether.

When I change the value in a dropdown listbox, I want to know what the
ORIGINAL value was so that I can PRESERVE that value when the page is
re-rendered. As it stands, I don't see any method that is fired BEFORE
postback that would allow me to store the original value of the listbox.

Do I just go back to good old fashioned javascript?


If the user is seeing the dropdown for the first time, then the value is the
default value. If this is a prepopulated form based on some choices the
user made earlier, well then the /original/ value would be stored in a
database or XML file or whatever you are using to store information.

--
W '04 <:> Open
Nov 16 '05 #2
"Curt Emich" <ce****@comcast.net> wrote in message news:<CN********************@comcast.com>...
Is there a better way in .NET to preserve the state of say, a dropdown list
other than using hidden fields and the like? I've noticed that the method
"SelectedIndexChanged" of a dropdown list is only called when "Autopostback"
is true. This seems to defeat the purpose altogether.

When I change the value in a dropdown listbox, I want to know what the
ORIGINAL value was so that I can PRESERVE that value when the page is
re-rendered. As it stands, I don't see any method that is fired BEFORE
postback that would allow me to store the original value of the listbox.

Do I just go back to good old fashioned javascript?


If you are thinking of returning to JavaScript
take a look at DecisionScript at www.VanguardSW.com
No more stateless worries - DecisionScript takes care of that for you.

=> Drop me a note by e-mail if this seems interesting to
you. Please include a copy of this message with your reply
-----

Jeff Bennett
Je**@Bennet-Tec.Com

* Bennet-Tec Information Systems, Inc
* 50 Jericho Tpk, Jericho, NY 11753
* Phone 516 997 5596, Fax - 5597
* RELIABLE Components Make You Look Sharp!
* TList/Pro * ALLText HT/Pro * MetaDraw *
* Custom Software Development Services Too.
* WWW.Bennet-Tec.Com

=================== ===================
Nov 16 '05 #3

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

Similar topics

2
by: rmorvay | last post by:
I am trying to dynamically build a dropdownlist and bind it to a cell in a grid. I tried to utilize the following code but I am stuck at the point where I bind the dropdownlist to the grid cell. ...
2
by: Leon Shaw | last post by:
have two Dropdownlist and one which is containing States and one containing Cities. I know how to do all the little databinding task in visual studios interface as well as set the relationship...
6
by: Robin Bonin | last post by:
In my user contol I am creating a set of dropdownlists. Each list is created based on input from the other lists. The problem I am having is setting the selected index on the lists. If someone...
2
by: rmorvay | last post by:
I am trying to dynamically build a dropdownlist and bind it to a cell in a grid. I tried to utilize the following code but I am stuck at the point where I bind the dropdownlist to the grid cell. ...
0
by: Theam Kok Ming | last post by:
Hi All, I am a newbie to ASP.Net 2.0 . I would appreciate if anyone can enlighten me on my doubts I am building a simple customer registration website. I have the tables and GridView to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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...

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.