Wrox Programmer Forums
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old October 22nd, 2006, 08:43 AM
Authorized User
Points: 209, Level: 4
Points: 209, Level: 4 Points: 209, Level: 4 Points: 209, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2005
Location: , , .
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Default Dropdownlist datasource

HI all

I need some help
I have 2 dropdownlist dd1 and dd2
At start i bound those 2 dropdown lists to 2 different datasources.
Each time that i change the selected value at dd1 i want to refresh the selected value and the datasource of dd2
I check the dd1 AoutPostBack flag to true and implement function for the event OnSelectedIndexChanged. in that function i change the datasource of dd2 and the selected value, the selected value of dd2 is changed but the datasource is not changing and i still see the same values in the list.
what am i doing wrong?

Keren
  #2 (permalink)  
Old October 22nd, 2006, 10:16 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Make sure that where you call your initial databind is wrapped in:

if(!Page.IsPostBack){
//Call databind
}

obviously the above code will only go in the Page_Load event but this will ensure that your intial databind is executed only once while a user is there.

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature


Similar Threads
Thread Thread Starter Forum Replies Last Post
DropDownList, DataSource and Selected Items kingroon ASP.NET 2.0 Basics 2 February 25th, 2008 10:41 AM
DataSource suhas_feb BOOK: Professional Jakarta Struts 1 June 19th, 2007 09:46 PM
Object datasource VS DataSource SoftMind BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 4 July 27th, 2006 10:44 PM
No datasource property sadermine Access 2 August 11th, 2005 05:55 PM
DataSource keseln J2EE 1 June 8th, 2003 08:45 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.