Redirecting to a page with a querystring and an anchor reference

G

Guest

I am working on an application that displays a list of items (biglist.aspx).
With each item, there is a link that takes the user to another aspx page for
updating the specific details of that item (updatedetails.aspx). That page
has a button event that saves changes and then redirects back to the main
list.

Here's my issue -- the list page takes a parameter in the querystring. I
have set up anchor tags for each item within the list. Therefore, for
instance, a user clicks on a link that takes him to:

biglist.aspx?listID=100#Item4

Under this scenario, the querystring value for "listID" is 100, as it should
be. This link will then take him directly to the anchor tag for item 4. This
works great when the user clicks on a link to get to that page. However, in
my button event that saves the updates, I am trying to do a Response.Redirect
to the link above to take the user back to the list and the item he was
working on. When I do the Response.Redirect, however, the querystring value
for "listID" reads in as "100#item4", which is obviously incorrect.

I also don't think Server.Transfer would work, since I need the broswer to
see the anchor reference to automatically move down the page to the right
spot.

Any ideas on how to get the desired behavior? Thanks!
 
G

Guest

Have you tried placing the bookmark before the query string?
biglist.aspx#Item4?listID=100

Cheers,
Steve Goodyear
 
G

Guest

Thanks for the suggestion. I hadn't tried that before, but when I did,

Request.QueryString["listID"].ToString()

brings back a null. It's as if moving the anchor reference makes it unable
to see the querystring.

Thanks,
Donny
 
G

Guest

I'm having the same problem. Is there anybody with a solution?
I'm using the Page.RegisterStartupScript though for adding the javascript
"document.location.href='#test';"

This is all in a user control, who is on an aspx page
 

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

Top