Click here to Skip to main content
12,830,643 members (41,233 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# ASP.NET
I want to fill list box values based on a condition.
in my sql server table there are fields lot_sold(list Box),Auction_Date(text box),registration no(ddl)
now from web form user first select Auction_date according to this date lot_sold for that Auction date are to be filled in list box lot (lot_code are multiple for that date).

how i achieve this please help.
Posted 6-Dec-12 8:55am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Look at AutoPostBack [^] and OnChange of your Auction Date control.

Basically you need to attach to the OnChange event of the Auction Date Control, when that changes you just need to query the database and pull out the details for the given date and populate your list box like you normally would.

**** EDIT ****
Oh yeah, when you are in your OnChange event you can access the value of what ever control you are using to select the auction date by looking at the corresponding property for that control
ruby kaur 6-Dec-12 23:24pm
please explain with example,
i am using textbox control for auction date and it is having ajax clender control to select date,and my lotcode is multiselect listbox.
on selection of date by user the list box has to be filled with all the lotcode of that auction date.

pls help me out.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170326.1 | Last Updated 6 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100