[英]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 .. 是否有任何选项或任何方法,我可以更改内容或表单,或将一个页面移至另一页面,而无需刷新页面或更改URL。
My client want a single url after login and need all the functionality . 我的客户在登录后只需要一个URL,并需要所有功能。
I m using asp.net with c# and this project is done 我在C#中使用asp.net,此项目已完成
is this possible? 这可能吗?
You have several options Javascript, CSS or lot of C# 您有几种选择Javascript,CSS或许多C#
Javascript Either you use Javascript to change the content of your page. Javascript您可以使用Javascript来更改页面的内容。 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.
在这种情况下,我建议您使用AngularJS,jQuery Backbone之类的Javascript框架...使用javascript,您将能够操纵页面的dom,从而更改内容。
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. CSS这是我不太有把握的一个选项。您可以显示:无用户不想显示的内容,也不会在用户单击内容时更改页面的可见部分。 It will require Javascript but wont be very dynamic
它将需要Javascript,但不会非常动态
C# Using variable POSTED to your unique Controller/Action you can choose which page to render in a Layout. C#使用变量POSTED到唯一的Controller / Action中,您可以选择要在布局中呈现的页面。 If you are using MVC.
如果您使用的是MVC。
You can simply use Server.Transfer("URL"). 您可以简单地使用Server.Transfer(“ URL”)。
It wont change your URL. 它不会更改您的URL。
您可以尝试添加一些jquery / ajax- https://api.jquery.com/load/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.