在aspx頁面我有錨標籤。我的網址已有Id參數,我想重複使用。 要求將用戶重定向到提及的當前網址ID爲例如如何在aspx頁面中使用Request.QueryString?
"~/Dir/Home?Id=" & Request.QueryString
請注意我必須在aspx頁面執行此操作,因爲無法使用頁面後面的代碼。
非常感謝
在aspx頁面我有錨標籤。我的網址已有Id參數,我想重複使用。 要求將用戶重定向到提及的當前網址ID爲例如如何在aspx頁面中使用Request.QueryString?
"~/Dir/Home?Id=" & Request.QueryString
請注意我必須在aspx頁面執行此操作,因爲無法使用頁面後面的代碼。
非常感謝
我想你可以使用這樣
'~/Dir/Home?Id=<%Request.QueryString.Get("ID")??""%>'
類似問題在SO
how to retrieve a querystring value from an .aspx page and pass it to ascx page
http://forums.asp.net/t/1655117.aspx
的easyest方式是一個名稱屬性添加到iframe標籤:
<iframe runat="server" id="frameid" name="framename" src="anypage.aspx"></iframe>
,然後添加這在Page_Load事件:
framename.Attributes.Item("src") = "thepage.aspx?id=" & Request.querystring("id")
簡單,乾淨,在VBNET中不需要JavaScript。
試試這個
href="contact_list.aspx?xid=<%= Request.QueryString["xeroID"].ToString()%>"
儘管此代碼可能會回答問題,但提供有關如何解決問題和/或爲何解決問題的其他上下文會提高答案的長期價值。 – Badacadabra 2017-06-15 15:42:08
由於它的工作)。 – 2017-03-21 07:45:48