473,322 Members | 1,501 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,322 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 22 '05 #1
3 1297
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 22 '05 #2
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 22 '05 #3
"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 22 '05 #4

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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.