Getting current page in Master Page

D

David C

I have a Master Page that I use for several web pages. In the code-behind
of the Master Page I have a Page_Load event that sets some information
inside the controls of the Master Page (see example below).

I would like to alter some of the Text properties of controls in the
MasterPage based on the page name, e.g. Default.aspx, HomePage.aspx, etc.
How do I determine the name of the web page that is opening? Thanks.

David

Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
LblTitle.Text = "New Web Page"
LBtnPhotos.Text = "Initial Photos"
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top