I have included an ASCX in Page A. What I want to do is tell the ASCX file which page it is on so that it will use that criteria to do a DB lookup.
Anyone? help...
Printable View
I have included an ASCX in Page A. What I want to do is tell the ASCX file which page it is on so that it will use that criteria to do a DB lookup.
Anyone? help...
Will Me.Name work?
Just a quick guess as I'm wandering by the thread...
No such thing. I want the parent nameQuote:
Originally posted by fungi
Will Me.Name work?
Just a quick guess as I'm wandering by the thread...
Sorry wishful thinking on my part...
Well I do know that at a minimum you can extract it from Request.FilePath but there's got to be a better .Netty way...
C#:
VB.Net:PHP Code:// This gets the pagename that the control is on. The format is:
// ASP.MyPage_aspx
string pageName = this.Page.ToString();
pageName = pageName.Substring(4, pageName.Length - 4);
pageName = pageName.Substring(0, pageName.Length - 5);
// Now the pageName variable should just hold 'MyPage'
VB Code:
Dim pageName = Me.Page.ToString() pageName = pageName.Substring(4, pageName.Length - 4) pageName = pageName.Substring(0, pageName.Length - 5)
Or you can use something like this:
Request.Path.ToString()
It will get you the full path and page of your current page.
thank you :p