简体   繁体   English

我们可以更改页面内容而不更改url吗?

[英]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/

  1. Ajax : Asynchronous data transfer and Dynamic DOM manipulation. Ajax :异步数据传输和动态DOM操作。 Can avoid url change and reload but content. 可以避免url更改和重新加载内容。
  2. MVC : Model–View–Controller. MVC :模型–视图–控制器。 Can avoid change of url but content 可以避免改变URL但内容

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 哪种技术可以在不更改URL的情况下更改页面内容? - What technology allows page content to change without changing the URL? 我们可以使用HttpHandler和HttpModule从母版页更改内容页div吗? - Can we use HttpHandler and HttpModule to change the content page div from the Master page? 在不更改url的情况下显示自定义页面 - Getting a custom page to show without changing the url 我们可以从母版页访问内容页面控件吗? - Can we access content page control from master page? 在Xamarin中浏览页面而不更改页面的全部内容 - Navigating through pages in Xamarin without changing the entire content of the page Blazor 导航:在不更改重新加载页面的情况下更新 URL - Blazor Navigation: Update URL without changing reloading page 页面重定向而不更改URL-Umbraco | C# - Page redirect without changing the URL-Umbraco | C# 如何在不更改 url 的情况下将某人重定向到错误页面 - How to redirect someone to the error page without changing the url 是否可以在不更改请求 Url 的情况下重新加载页面 Url? - Is it possible to reload page Url without change request Url? 我们可以在xamarin表单的标签页上添加内容吗? - Can We add content Above tabbed page in xamarin forms?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM