Does a MasterPage know what page is being displayed?

前端 未结 12 1749
無奈伤痛
無奈伤痛 2021-01-02 11:53

When I navigate on a website utilizing MasterPages, does the application know what page I am on? If so, does it store it in an object I can access?

The reason I am

12条回答
  •  滥情空心
    2021-01-02 12:15

    string s = this.Page.GetType().FullName;
    string[] array = s.Split('_');
    int count = array.Count();
    string currentPage = array[count - 2];
    

提交回复
热议问题