string filePath = Context.Request.FilePath; string pageName = filePath.Substring(filePath.LastIndexOf('/') + 1); //pageName will now hold the name of the file requested
Once we figure out which page is being requested, we can handle the behavior.
For example, if the page "NoBorderTables.aspx" should set all the tables to have no border, you can execute some code like this:
protected void Page_Load(object sender, EventArgs e) { if(!IsPostBack) { string filePath = Context.Request.FilePath; string pageName = filePath.Substring(filePath.LastIndexOf('/') + 1); switch(pageName.ToLower()) { case "NoBorderTables.aspx": foreach (Table t in this.Page.Controls) { t.BorderStyle = BorderStyle.None; } break; ) ) }