Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

List Box:  First line selected when page loads.

Posted on 2012-03-15
2
352 Views
Last Modified: 2012-03-25
I have a List Box on a web page as described below:
         
Robert
Marilyn
Candace
June
Justin

The first line of the list box is blank, indicated by the below code

ListItem li3 = new ListItem("", "0");

I need the blank line to have the focus when the web page opens.
That is, the blank line will be selected when the page loads without the user selecting it.

Any help is greatly appreciated.

Thanks!
0
Comment
Question by:jordanhelen
  • 2
2 Comments
 
LVL 14

Expert Comment

by:systan
ID: 37726174
listbox1.selectedindex = 0
0
 
LVL 14

Accepted Solution

by:
systan earned 500 total points
ID: 37726198
or  
      Listbox1.Items.Insert(0, "")
      Listbox1.SelectedIndex = 0
      Listbox1.Select()
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question