0
試圖讓它在SharePoint 2010中工作。 我在頁面A上有一個超鏈接,它轉到頁面B並傳遞查詢字符串值。 我想在頁面B上創建一個使用當前查詢字符串值傳遞給頁面C的新超鏈接,這可能嗎?我將如何去做這件事。SharePoint創建與當前頁查詢字符串的變量的超鏈接
謝謝。
試圖讓它在SharePoint 2010中工作。 我在頁面A上有一個超鏈接,它轉到頁面B並傳遞查詢字符串值。 我想在頁面B上創建一個使用當前查詢字符串值傳遞給頁面C的新超鏈接,這可能嗎?我將如何去做這件事。SharePoint創建與當前頁查詢字符串的變量的超鏈接
謝謝。
javascript代碼:
document.location =
document.location.href.split('?')[0].replace('pageB','pageC') +
document.location.href.split('?')[1];
或
document.location =
document.location.host + '/pathToPage/pageC.htm' +
document.search;
可以使用ASP.NET
例如你有一個鏈接參數在你的URL創建一個動態鏈接控件
// http://localhost/home.aspx?link=http://www.google.com
,然後請求您的參數
if (Request.QueryString["link"] != null){
string myhyperlink = Request.QueryString["link"];
現在,你需要一個超鏈接控件添加到您的網頁
HyperLink hyp = new HyperLink();
hyp.ID = "hypABD";
hyp.NavigateUrl = myhyperlink;
Page.Controls.Add(hyp);
希望這有助於