Does a MasterPage know what page is being displayed?

前端 未结 12 1750
無奈伤痛
無奈伤痛 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条回答
  •  猫巷女王i
    2021-01-02 12:18

    You should be able to get the page by accessing the Page property. IE:

    string type = this.Page.GetType().Name.ToString();
    

提交回复
热议问题