In my SiteMaster.cs file I am using the following query to retrieve data from my database:
SqlCommand comm = new SqlCommand("SELECT ID, Title, Name, Keywords, Descr FROM pages WHERE ID=1", conn);
I would like to do the following:
a) determine the current page & b) use this page to set a pageID variable equal to a certain number.
So if I was on (say) Default.aspx I could do something like…
// determine file name // if (file name == 'default.aspx') { pageID = 1; }
Would love some help with this.
Many thanks!!
You can do this to get the current aspx filename: