Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
608 views
in Technique[技术] by (71.8m points)

c# - How to change the querystring on the same page without postback

I want to change the querystring on the page where I write notes. When I save the note I want the querystring to have the entry for that note. So after the initial save the user can update based on the querystring. But to update the querystring I need to do full postback. Is there anyway to change the querystring like this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

No, you cannot change the current query string without reloading. You could use the frgament portion of the url though (#). Setting the fragment portion might allow you to add some entries to the browser history without reloading.

For example if your current url is http://example.com/foo you could change it to http://example.com/foo#bar=baz without reloading the current page.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...