简体   繁体   中英

Can we change the content of the page without changing the url?

Is there any option or any method , i have change content or form or move one page to another without refreshing the page or change in the url ..

My client want a single url after login and need all the functionality .

I m using asp.net with c# and this project is done

is this possible?

You have several options Javascript, CSS or lot of C#

Javascript Either you use Javascript to change the content of your page. In that case I advise you to use a Javascript Framework like AngularJS, jQuery Backbone ... With javascript you will be able to manipulate the dom of your page and so to change the content.

CSS This is the one option I not very confident in. You can display:none the content you dont want to display and change the visible part of your page as your user is clicking on content. It will require Javascript but wont be very dynamic

C# Using variable POSTED to your unique Controller/Action you can choose which page to render in a Layout. If you are using MVC.

You can simply use Server.Transfer("URL").

It wont change your URL.

您可以尝试添加一些jquery / ajax- https://api.jquery.com/load/

  1. Ajax : Asynchronous data transfer and Dynamic DOM manipulation. Can avoid url change and reload but content.
  2. MVC : Model–View–Controller. Can avoid change of url but content

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