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
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