Wednesday, October 15, 2014

Get the name of the current page in web forms.

This suggests this:

var x = this.Page.ToString().Substring(4, this.Page.ToString().Substring(4).Length - 5);
x = x + ".aspx";

 
 

...which seems to work just fine. I have this line(s) of code inside of the Page_Load event on a MasterPage.

No comments:

Post a Comment