I\'m writing code on the master page, and I need to know which child (content) page is being displayed. How can I do this programmatically?
I do something similar to this in a project of mine to dynamically attach css files based on the page being loaded. I just get the name of the file from the request:
this.Request.Url.AbsolutePath
And then extract the file name from there. I'm not sure if this will work if you are doing URL re-writes though.