Peter, That works, but is there a way to not to put the focus on myDDL? I prefer to go alittle higher in the html. This way the it would act like a named anchor. Thanks for your help. Greg
_____ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Peter Brunone Sent: Thursday, December 22, 2005 3:34 PM To: [email protected] Subject: Re: [AspNetAnyQuestionIsOk] Return to page location after dropdown select Hi Greg(ory), You're right that according to the code below, you won't get any list items without a selected value... which you won't get on Response.Redirectunless you're using EasyListBox with CookieMemory turned on. You could get around this by leaving a "Case Else" in there, but it sounds like you're in the middle of a population when that happens. How about this? In your dropdown's OnSelectedIndexChanged event handler sub (server-side), you can send some Javascript back to focus on it, like this: Page.RegisterStartupScript("gotoDDL", "<script language='javascript'> document.getElementById('" & myDDL.ClientID & "').focus();</scr" & "ipt>") (that last concatenation is because a closing script tag in single-page mode will confuse the parser) Of course if you want to avoid postbacks to populate your lists, you could roll your own client-side solution (see http://easylistbox.com/listBoxResources.aspx ) or you might consider ELB ( http://easylistbox.com/demoRelated.aspx?rl=af ) as a possible alternative. HTH, Peter On 12/22/05, Gregory Fox <[EMAIL PROTECTED]> wrote: > > Hi All, > > I have a series of dropdown box on the middle of a web page. When I select > an item it is to populate the next dropdown box. This works well, however > on > the postback the page go to the top and I have to scroll down to the > dropdowns. My question is is there a way to get back to the dropdown boxes > on the postback? > > I have tried using an anchor and in the vb code using a > response.redirect("page.aspx#anchor"), it brings me back to the dropdowns, > but they are not populating. I think it has to do with the dropdown being > populated in the code using items.add("item") method. For example > > select case dropdown0.SelectedValue > case 1 > dropdown1.Items.Add("item1") > dropdown1.Items.Add("item2") > dropdown1.Items.Add("item3") > case 2 > dropdown1.Items.Add("item1") > dropdown1.Items.Add("item2") > dropdown1.Items.Add("item3") > end select > response.redirect("page.aspx#anchor") > > Any help is appreciated. > > Gregory D. Fox > Liberty Web Hosting & Design > <mailto:[EMAIL PROTECTED]> LibertyHosting.net > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Providing Internet Solutions Since 1996 > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > [Non-text portions of this message have been removed] > > > > > > Yahoo! Groups Links > > > > > > > > [Non-text portions of this message have been removed] _____ YAHOO! GROUPS LINKS * Visit your group "AspNetAnyQuestionIsOk <http://groups.yahoo.com/group/AspNetAnyQuestionIsOk> " on the web. * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED] e> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service <http://docs.yahoo.com/info/terms/> . _____ [Non-text portions of this message have been removed] ------------------------ Yahoo! Groups Sponsor --------------------~--> 1.2 million kids a year are victims of human trafficking. Stop slavery. http://us.click.yahoo.com/.QUssC/izNLAA/TtwFAA/saFolB/TM --------------------------------------------------------------------~-> 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/
