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:
however i get a Compiler Error Message: BC30037: Character is not valid.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;
any ideas...?
thank you,
wc.





Reply With Quote