Truncating Query String & Returning Clean URL C# ASP.net

后端 未结 7 1860
遥遥无期
遥遥无期 2020-12-25 10:11

I would like to take the original URL, truncate the query string parameters, and return a cleaned up version of the URL. I would like it to occur across the whole applicatio

7条回答
  •  庸人自扰
    2020-12-25 10:30

    Here is a simple trick

    Dim uri = New Uri(Request.Url.AbsoluteUri)
    
    dim reqURL = uri.GetLeftPart(UriPartial.Path)
    

提交回复
热议问题