|
-
Oct 28th, 2004, 03:31 AM
#1
Thread Starter
Fanatic Member
FindByValue
hello,
this might be real simple however i'm a .net beginner and can't find a solution to this.
i'm filling in programmatically the values of a DropDownList. i would then like to select in the this DropDownList also programmatically, just as you would in inserting the SELECTED tag of an OPTION html statement (i.e. <option value="x" SELECTED> This is my selected value</option>).
i currently have:
Code:
Dim t1 as ListItem = New ListItem("Main Template 01", "1")
Dim t2 as ListItem = New ListItem("Sub Template 02", "2")
Template.Items.Add(t1)
Template.Items.Add(t2)
'select item in drop down list
Template.Items.FindByValue("1").Selected = True;
however i get a Compiler Error Message: BC30037: Character is not valid.
any ideas...?
thank you,
wc.
Last edited by wildcat_2000; Oct 28th, 2004 at 03:44 AM.
When your car breaks down,
close all windows and retry 
=> please rate all users posts! <=
-
Oct 28th, 2004, 03:40 AM
#2
Re: FindByValue
Originally posted by wildcat_2000
Template.Items.FindByValue("1").Selected = True;
-
Oct 28th, 2004, 03:44 AM
#3
Thread Starter
Fanatic Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|