开发者

Change url on server side

开发者 https://www.devze.com 2023-03-29 20:45 出处:网络
When user clicked on A tag ( <a href=\'showSomething.aspx?id=11&key=fixed\'>Bring Something</a> ) showSomethingPage.aspx will be shown with URL parameters. But I want to change URL fro

When user clicked on A tag ( <a href='showSomething.aspx?id=11&key=fixed'>Bring Something</a> ) showSomethingPage.aspx will be shown with URL parameters. But I want to change URL from show开发者_开发知识库Something.aspx?id=11&key=fixed to showSomething.aspx?key=fixed in despite of shown the thing with id 11.


Try saving the ID in the session state and then using Response.Redirect.


Use a redirect:

C# code (put this in Page_Load or something):

Response.Redirect("showSomething.aspx?&key=fixed");


If you just want to hide the URL from the status bar your link, use the onclick event to open the URL:

a href="javascript:void(0)" onclick="window.location='showSomething.aspx?id=11&key=fixed'"

Hope it helps you. ;)


You can save the id in the session and then redirect to showSomething.aspx?key=fixed. then showSomething.aspx?key=fixed will read the session and file the id=11 and show it.

0

精彩评论

暂无评论...
验证码 换一张
取 消