我想在 C# 中的重定向之前从我的 Request.UrlReferrer.AbsoluteUri 中删除查询字符串部分。
例如,如果你有你的
Request.UrlReferrer.AbsoluteUri = "http://localhost:8080/english/index_2011.aspx?logout=true"
现在我要
Response.Redirect(Request.UrlReferrer.AbsoluteUri) without QueryString part (?logout=true")
请建议使用C#
最佳答案
使用 Request.UrlReferrer.AbsoluteUri.ToString().Split('?')[0]
这应该可以解决问题。
关于c# - 如何从 C# 中的 Request.UrlReferrer.AbsoluteUri 中删除查询字符串部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4884322/