Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to set a ListBox value?

Status
Not open for further replies.

cmn2

Programmer
Mar 6, 2003
73
US
Greetings

I have a asp:listbox where I would like to have the first item selected when the page is first rendered, but I'm not sure how to do this. Could anyone help me on this?

Thank you

<ASP:ListBox id="lstCompany" runat="server" Width="90" Height="80">
<ASP:ListItem Value="1">MyCompany</ASP:ListItem>
<ASP:ListItem Value="2">YourCompany</ASP:ListItem>
<ASP:ListItem Value="3">TheirCompany</ASP:ListItem>
</ASP:ListBox>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top