Removing a querystring from url in asp.net

后端 未结 4 672
[愿得一人]
[愿得一人] 2020-12-18 15:36

HI, I need to remove a querystring when a user clicks a particular LinkButton. So for example if the querystring is http://UserProfileManager.com?UserID=1234 .... when the u

4条回答
  •  难免孤独
    2020-12-18 16:16

    Look at the request object - while I can't remember the exact properties, there are ones line scheme (which would return "http://") - there will be one, or a combination that will give you what you require.

    Further research - look at the Request.Url property. Then strip off the query string. I couldn't see an exact method in the uri / uricomponent classes to give you exactly what you are looking for, but it shouldn't be that hard.

提交回复
热议问题