uzay95
uzay95

Reputation: 16642

Change url on server side

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 showSomething.aspx?id=11&key=fixed to showSomething.aspx?key=fixed in despite of shown the thing with id 11.

Upvotes: 0

Views: 2736

Answers (4)

Daniel
Daniel

Reputation: 31609

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.

Upvotes: 0

Nathanial Woolls
Nathanial Woolls

Reputation: 5291

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

Upvotes: 1

andreszs
andreszs

Reputation: 2956

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. ;)

Upvotes: 0

jli
jli

Reputation: 6623

Use a redirect:

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

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

Upvotes: 0

Related Questions