Absolute URL Cookieless

前端 未结 2 1147
Happy的楠姐
Happy的楠姐 2021-01-16 15:40

Is there some method in asp.net for getting an absolute url with cookieless session?

UPDATE: I need create other new URL. It is not requested URL.

I´m using

2条回答
  •  半阙折子戏
    2021-01-16 16:19

    Did you try Request.Url.ToString(). It should work for you. If you needed was the url of another page on your site then you can proceed like this...

    String url = new Uri(Context.Request.Url, ResolveUrl("~/ABC.aspx")).ToString )

    We also have something like Request.Url.AbsoluteUri

    I hope One of the above should work for you.

提交回复
热议问题