Results 1 to 3 of 3

Thread: FindByValue

  1. #1

    Thread Starter
    Fanatic Member wildcat_2000's Avatar
    Join Date
    Nov 2000
    Location
    Italy
    Posts
    727

    Resolved 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! <=

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: FindByValue

    Originally posted by wildcat_2000

    Template.Items.FindByValue("1").Selected = True;



  3. #3

    Thread Starter
    Fanatic Member wildcat_2000's Avatar
    Join Date
    Nov 2000
    Location
    Italy
    Posts
    727
    oh my...!

    damn me and my obsession with SQL statements and javascript

    this must happen to other cross-language programmers, i seriously do hope LOL

    thank you mendhak

    cheers,

    wc.
    When your car breaks down,
    close all windows and retry

    => please rate all users posts! <=

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width