Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional 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
 
Old February 14th, 2006, 06:17 PM
Registered User
 
Join Date: Jan 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to hawkfb63
Default Populating DropDownList from multiple sources

I am trying to populate a dropdown list with company names that are stored in a database. I am able to do that fine. I also want the dropdown list to have the default value be "New Company" so if they select no company, it will redirect them to a page where a new company profile can be created. Any help on this would be greatly appreciated.
Luke

 
Old February 14th, 2006, 06:33 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

You can set AppendDataBoundItems to True on the drop-down list, and the simply add the static item in the markup of the page.

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Hospital Food by Eels (Track 6 from the album: Electro-shock Blues) What's This?
 
Old February 14th, 2006, 06:42 PM
Wrox Technical Editor
 
Join Date: Dec 2005
Posts: 271
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The following link outlines a solution quite nicely..

http://weblogs.asp.net/scottgu/archi...29/436804.aspx

In short you'll need to define an additional ListItem in your DropDownList.
<asp:DropDownList .... >
   <asp:ListItem Text="New Company" Value="" />
</asp:DropDownList>


- A.Kahtava





Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple Datasets from multiple Data Sources SQL_Hacker Reporting Services 1 June 18th, 2008 02:25 PM
Deal with multiple sources Hind XSLT 2 June 5th, 2006 07:16 AM
Query from multiple data sources billmedd BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 September 27th, 2004 10:46 AM
Populating DropDownList hugh@kmcnetwork.com ASP.NET 1.0 and 1.1 Professional 1 November 14th, 2003 03:35 PM





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