Hi there

To get the first item that is selected  inthe listbox you need the follwoing
code

form name.list box1,listindex

HTH

Rich
----- Original Message ----- 
From: "Mario Ramos (Ext)" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, April 14, 2005 4:18 PM
Subject: [AspNetAnyQuestionIsOk] Focus and Select listbox item on page load



Hi guys,

I'm trying to get the first item of a listbox selected on page load.

I got the control focused but how do I get the item selected?

I'm using in page_load:

Dim strBuilder As StringBuilder = New StringBuilder()

        strBuilder.Append("<script language='javascript'>")
        strBuilder.Append(" document.getElementById('lstbxLines').focus();")
        strBuilder.Append(" document.getElementbyid('lstbxLines').select()")
'<-- not working!!!
        strBuilder.Append("</script>")

        RegisterStartupScript("Focus", strBuilder.ToString())
        '

Thankx

M�rio

M�rio Ramos
SADTEAM - Siemens Archibus Development Team
Servi�os IntegradosTM
Siemens Medical Solutions
Edif�cio Minho
Telf.: +351 22 999 22 84
Fax.: +351 22 999 22 88
Email: [EMAIL PROTECTED]




[Non-text portions of this message have been removed]




Yahoo! Groups Links









 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to