Does a MasterPage know what page is being displayed?

前端 未结 12 1684
無奈伤痛
無奈伤痛 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 11:58

    Yes, Use the below code in your master file. It will give you the content page name.

    Page.ToString().Replace("ASP.","").Replace("_",".")
    

提交回复
热议问题