MasterPage.Master> Which page will be loaded next time as a child?

I would like to know in the Page Load event of my MasterPage.Master , page has sent request. will be loaded as content into content.

Suppose a user clicks on my web page <a href="Login.aspx">Login</a> , can I get this value from the Page Load event of my MasterPage.Master for further processing?

 Dim ThePageThatWillLoadAsChildIs as string = 

You see that I would like to use this, so when the request page is ex Login.aspx, add some attributes to the form element of my web page.

+4
source share
3 answers

Look at the Request.Url property and get the necessary information there

+3
source

I think you are looking for Request.UrlReferrer

+1
source

Ok, this does the trick (on loading the main page)

 Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim TheNextPageThatWillLoad As String = DirectCast(sender, MasterPage).Request.RawUrl End Sub 
0
source

Source: https://habr.com/ru/post/1344058/


All Articles