Newbie Question about DropList and Page Load

Discussion in 'ASP .Net' started by Meir Rotfleisch, Nov 2, 2003.

  1. Hi

    I am trying to populate the Droplist with Items during the page load event
    however the Droplist remains blank..

    The code is

    Dim I As Integer

    if not page.ispostback then

    For I = 1 To 31

    Me.DropDownList1.Items.Add(I.ToString())

    Next



    End if





    Suggestions?

    Regards

    Meir
     
    Meir Rotfleisch, Nov 2, 2003
    #1
    1. Advertising

  2. Hi

    Is very strange!

    Can you post the code of the whole page?

    Ciao
    Giorgio

    "Meir Rotfleisch" <> ha scritto nel messaggio
    news:...
    > Hi
    >
    > I am trying to populate the Droplist with Items during the page load event
    > however the Droplist remains blank..
    >
    > The code is
    >
    > Dim I As Integer
    >
    > if not page.ispostback then
    >
    > For I = 1 To 31
    >
    > Me.DropDownList1.Items.Add(I.ToString())
    >
    > Next
    >
    >
    >
    > End if
    >
    >
    >
    >
    >
    > Suggestions?
    >
    > Regards
    >
    > Meir
    >
    >
     
    Giorgio Parmeggiani, Nov 2, 2003
    #2
    1. Advertising

  3. Meir Rotfleisch

    Thomas F.B. Guest

    On Sun, 02 Nov 2003 14:36:09 +0200, Meir Rotfleisch wrote:
    >
    > I am trying to populate the Droplist with Items during the page load event
    > however the Droplist remains blank..
    > ...
    > Me.DropDownList1.Items.Add(I.ToString())
    >


    Try to add instances of 'System.Web.UI.WebControls.ListItem'
    instead of strings (i.e. the above 'I.ToString()').

    --
    mailto: (foo = net)
     
    Thomas F.B., Nov 2, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lasse Edsvik

    Filelist -> Droplist?

    Lasse Edsvik, Oct 4, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    425
    =?Utf-8?B?c3Jpbmk=?=
    Oct 4, 2004
  2. TJS
    Replies:
    4
    Views:
    2,977
  3. TJS
    Replies:
    2
    Views:
    718
  4. =?Utf-8?B?Sm9obiBTLg==?=
    Replies:
    0
    Views:
    369
    =?Utf-8?B?Sm9obiBTLg==?=
    Sep 11, 2007
  5. Replies:
    3
    Views:
    149
Loading...

Share This Page