|
-
May 14th, 2003, 01:02 PM
#1
Thread Starter
PowerPoster
Ascx Question
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...
-
May 14th, 2003, 01:21 PM
#2
Hyperactive Member
Will Me.Name work?
Just a quick guess as I'm wandering by the thread...
-
May 14th, 2003, 01:22 PM
#3
Thread Starter
PowerPoster
Originally posted by fungi
Will Me.Name work?
Just a quick guess as I'm wandering by the thread...
No such thing. I want the parent name
-
May 14th, 2003, 01:46 PM
#4
Hyperactive Member
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...
-
May 14th, 2003, 02:15 PM
#5
PowerPoster
C#:
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.Net:
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.
-
May 14th, 2003, 02:19 PM
#6
Thread Starter
PowerPoster
thank you
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|