Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old September 24th, 2005, 01:57 PM
Registered User
 
Join Date: Sep 2005
Location: jaipur, rajasthan, India.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to assign value in dropdown list

Hello,

I have a ddl that displays cities for the user to select.
ID City
1 Toronto
2 St. John's
3 Halifax

If the user selects St. John's (ID =2), the ID 2 gets wrote to the database for that user..this is fine, however when the user comes back to the page and changes some other data and NOT the city, St. John's gets ID=1 in the ddl, so when the user writes to the database again, the city changes to Toronto (ID=1)...

HOW DO I GET AROUND THIS. I am programming in VB.NET and using a Access database. i have also assign the value in dropdown list in page load event

Please any help is greatly appricated.

ankur

ankur bhargava
  #2 (permalink)  
Old September 25th, 2005, 12:45 AM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Are you putting the binding code in an if not ispostback statement:?

if not ispostback then
   ddl.databind()
end if

  #3 (permalink)  
Old September 25th, 2005, 01:20 PM
Registered User
 
Join Date: Sep 2005
Location: jaipur, rajasthan, India.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ya i am checking the is postback in pageload event
the problem is actually the dropdown doesnt maintain its viewsate despite the viewstate prop is true

ankur bhargava
  #4 (permalink)  
Old September 26th, 2005, 12:07 AM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Can you please post your code? Thanks

 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dropdown list maha .NET Framework 2.0 7 April 28th, 2007 01:32 AM
fill dropdown list with items when parent list isaac_cm Pro PHP 1 July 10th, 2006 06:41 AM
HELP WITH DROPDOWN LIST enavas Excel VBA 1 April 6th, 2004 03:08 PM



All times are GMT -4. The time now is 12:58 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.