Inland Empire .NET User's Group Forums
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Adding a static item to dropdownlist when it...Expand / Collapse
Author
Message
Posted 4/26/2008 11:46:34 PM


Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: 6/23/2008 10:35:27 PM
Posts: 48, Visits: 204
Hi,
today in the class, i was asked how to bind the dropdownlist to a sqldatasource, as wells as adding some static items. It is easy, you set the AppendDataBoundItems property of the dropdownlist to true, and add your static item., an example is below: there is a dropdownlist binded to sqldatasource which gets the categories from the northwind database, and also a static listitem is added to the dropdownlist. you can also see, how we can use requiredfieldvalidator :
[php]
ropDownList ID="listCategories" runat="server"
DataSourceID="SqlDataSource1" DataTextField="CategoryName"
DataValueField="CategoryID" AppendDataBoundItems="True">

ropDownList>
Text="(Required)" ControlToValidate="listCategories" runat="server" />





ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT [CategoryID], [CategoryName] FROM [Categories]">

[/php]

i am back
Post #168
Posted 4/28/2008 12:04:27 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 6/21/2008 7:09:10 AM
Posts: 9, Visits: 23
Thanks Volkan! But, why the [php]? Are those tags for VS2008?

Will you be posting your slides from Weeks 4 and 5 here too?

I will post my application soon, but I've been busy at work lately (conversion headaches). It is working, but I want to do some cleanup before I post it.

Steve

P.S. You are to be commended for doing an excellent job of teaching us ASP.NET. I have already gained much insight and have been able to leverage what I already know in Delphi, Java, and Oracle toward C#, ASP.NET, and SQL Server. I personally feel the class has been worth my time.

Free advice! Worth every cent!

Post #170
Posted 4/28/2008 4:10:35 PM


Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: 6/23/2008 10:35:27 PM
Posts: 48, Visits: 204
Hi Stevem

i keep forgetting the slides, i ll do it tonight. i put the [php] tags cause %99 of the forums in the world  support this special tag, and anything u put in between this tag should be formatted nicely . apprarently our forum doesnt support it

i am back

Post #171
Posted 4/29/2008 4:59:46 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 6/21/2008 7:09:10 AM
Posts: 9, Visits: 23
Ah... I see: [php] injection!

Looking forward to the slides.

Gotta head out to work now...

Free advice! Worth every cent!

Post #172
« Prev Topic | Next Topic »


PermissionsExpand / Collapse

All times are GMT -8:00, Time now is 11:23am

Powered By InstantForum.NET v4.1.3 © 2008
Execution: 0.515. 13 queries. Compression Enabled.