本文介绍了添加哈希当前URL没有在C#中重载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过追加#值来更新当前的URL。我的问题是,当我运行下面的命令然后刷新页面

I am trying to update the current url by appending # value. My problem is when I run the following commands then it refreshes the page

      this.Response.Redirect(Request.RawUrl+ "#" + hashvalue);
      this.Response.Redirect("/my path#"+hashvalue);

据刷新我的网页。我不希望它刷新,因为我有preserve页面上的一些看法。我知道这样的选择在JavaScript和jQuery也有,但我怎么能做到这一点在C#asp.net

It refreshes my page. I don't want it to refresh as I have to preserve some view on the page. I know such options are available in javascript and jquery but how can I do that in C# asp.net

我已签其他的答案在这个论坛上,但也没有发现任何针对C#

I have checked other answers on this forum but could not found any for c#

推荐答案

您不能做到这一点使用C#,因为ASP.NET是服务器端技术。你可以使用jQuery后Ajax请求(S)到您的ASP.NET应用程序,然后刷新页面的某些部分。

You can't do this using C# because ASP.NET is server-side technology. You could use jquery to post AJAX request(s) to your ASP.NET application and then refresh certain parts of your page. http://api.jquery.com/jquery.post/

这篇关于添加哈希当前URL没有在C#中重载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-31 13:33