get current page from url

前端 未结 6 1807
无人及你
无人及你 2020-12-30 19:45

I want to write a c# method to retrieve the current page. eg Default6.aspx I know I can do the following:

string url = HttpContext.Current.Request.Url.Absolu         


        
6条回答
  •  离开以前
    2020-12-30 20:26

    You could try this below.

    string url = "http://localhost:1302/TESTERS/Default6.aspx";
    
    string fileName = System.IO.Path.GetFileName(url);
    

    Hope this helps.

提交回复
热议问题