"Antonio" <(E-Mail Removed)> wrote in news:1123594526.368603.223910
@z14g2000cwz.googlegroups.com:
> Hi, in my page's <body tag>'s "onload" javascript event I want to call
> a javascript method that will change the selected index of a drop down
> list. I want it to happen every time the page gets refreshed but not
> do it with codebehind, it has to be javascript.
>
> How do I do it?
document.getElementById('dropdownlistname').selectedIndex = indexNumber
You can get the dropdownlist name via the .NET ClientID property of each
control.
So you'll have to dynamically output the javascript via codebehind. Take
a look at the function Page.RegisterClientScriptBlock on an example of
including dynamically written javascript.
http://msdn.microsoft.com/library/de...l=/library/en-
us/cpref/html/frlrfSystemWebUIPageClassRegisterClientScriptBlockTopic.as
p
--
Lucas Tam ((E-Mail Removed))
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/