Navigation: Control where user winds up on the page?

J

Jane Hawkins

Here's my basic need:
1. User clicks on a button
2. Button click event causes some additional controls to appear.
3. User is positioned at start of those additional controls when the page
returns.

Things I've tried:
1. Put the button in an href like so:
<A HREF='#WhereToGo'><asp:button runat=server [blah
blah]></asp:button></a>
Result: Hover over the blah blah button seems to indicate that it go to
right place but it doesn't.

2. Add "runat=server" to <a> tag -- no change.

3. Use HttpContext in the button click event handler:
NewPath=Request.Path.ToLower()+ "#WhereToGo";
HttpContext myContext = HttpContext.Current;
myContext.RewritePath(NewPath);
Result: The first time the page returns, no position change. The next time
there's a postback, user is at the correct position. Encouraging, but
useless.

4. Put the code from #3 into Page_Load
Result: The page does go to "WhereToGo". Problem is, I don't know how to
get the right value for it because the event handler hasn't yet been hit.

Can any of you give me a clue here?

Thanks much,

Jane Hawkins
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top