Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string pageName = this.ContentPlaceHolder1.Page.GetType().FullName;
- //Page_Load
- MyMaster m = (MyMaster)this.Master;
- m.TellMasterWhoIAm(this);
- //Only show the message if on the dashboard (first page after login)
- if (this.ContentPlaceHolder1.Page is Dashboard)
- {
- //Show modal message box
- mmb.Show("Warning Message");
- }
- Page.ToString().Replace("ASP.","").Replace("_",".")
- if (Page.TemplateControl.AppRelativeVirtualPath == "~/YourPageName.aspx")
- {
- // your code here
- }
- if (Page.TemplateControl.AppRelativeVirtualPath.Equals("~/YourPageName.aspx", StringComparison.OrdinalIgnoreCase))
- {
- // your code here
- }
- this.Request.Url.AbsolutePath
- string pageName = this.Request.Url.Segments.Last();
- if (pageName.Contains("EmployeeTermination.aspx"))
- {
- }
- Request.CurrentExecutionFilePath;
- Request.AppRelativeCurrentExecutionFilePath;
- string s = Page.ToString().Replace("ASP.directory_name_","").Replace("_aspx",".aspx").Replace("_","-");
- if (s == "default.aspx")
- { /* do something */ }
- <%if(this.MainContent.Page.Title != "mypagetitle") { %>
- <%}%>
- // Assuming MyPage1, MyPage2, and MyPage3 are the class names in your aspx.cs files:
- if (this.Page is MyPage1)
- {
- // do MyPage1 specific stuff
- }
- else if (this.Page is MyPage2)
- {
- // do MyPage2 specific stuff
- }
- else if (this.Page is MyPage3)
- {
- // do MyPage3 specific stuff
- }
Add Comment
Please, Sign In to add comment