3

In aspx page I have anchor tags. My URL already has Id parameter which I want to reuse. Requirement is to redirect user to a mentioned page with current url id e.g.

"~/Dir/Home?Id=" & Request.QueryString

Please note I have to do this in aspx page as cant use code behind pages.

Thanks a lot

4 Answers 4

8

You can use scriptlets

'~/Dir/Home?Id=<%= Convert.ToString(Request.QueryString["ID"]) %>';

You can learn more about using QueryString here

Sign up to request clarification or add additional context in comments.

Comments

3

I think you can use like this

'~/Dir/Home?Id=<%Request.QueryString.Get("ID")??""%>'

Similar question on SO
how to retrieve a querystring value from an .aspx page and pass it to ascx page
http://forums.asp.net/t/1655117.aspx

Comments

0

The easyest way is to add a name attribute to the iframe tag:

<iframe runat="server" id="frameid" name="framename" src="anypage.aspx"></iframe>

and then add this on the page_load event:

framename.Attributes.Item("src") = "thepage.aspx?id=" & Request.querystring("id")

Easy, clean and in VBNET no JavaScript needed.

Comments

0

try this

href="contact_list.aspx?xid=<%= Request.QueryString["xeroID"].ToString()%>"

1 Comment

While this code may answer the question, providing additional context regarding how and/or why it solves the problem would improve the answer's long-term value.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.