简体   繁体   中英

MVC.net prevent the URL changing

I have a service method that returns a short link for a survey for example http://iu.eg/Cx3f7
clicking this short link, calls an action method which returns a view and the short URL changes to the actual one for example http://Surveys.com/Survey/12
in the browser address bar
is there away to prevent the URL changing and keep using the short one?

You can try opening the survey inside an iframe html element. It opens up another webpage inside your current webpage.... Thats the only you will go about not changing the url in the browser. You cant change the URL directly (without redirecting to another page), therefore this is a workaround for your desired result.

Try this : How can I load a webpage into an iframe, using ASP.NET MVC?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM