How do you find the name of the ascx file from inside?

Discussion in 'ASP .Net' started by ThazKool, Sep 29, 2006.

  1. ThazKool

    ThazKool Guest

    I am trying to get the name of the ascx file from inside a C# script
    tag inside the ascx file. I have looked through all the properties of
    the control, but I cannot find anything that gives some sort of path or
    name. Can anyone help?

    Thanks,
    ThazKool
     
    ThazKool, Sep 29, 2006
    #1
    1. Advertising

  2. Try:
    this.AppRelativeVirtualPath
    (Only available in .NET 2.0.)

    If you want to get just the name of the control type, maybe try:
    this.GetType().ToString()

    ThazKool wrote:

    > I am trying to get the name of the ascx file from inside a C# script
    > tag inside the ascx file. I have looked through all the properties of
    > the control, but I cannot find anything that gives some sort of path or
    > name. Can anyone help?
    >
    > Thanks,
    > ThazKool
     
    Chris Fulstow, Sep 29, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Quentin
    Replies:
    1
    Views:
    492
    Quentin
    Jul 29, 2003
  2. Jason Shohet
    Replies:
    1
    Views:
    487
    Kevin Spencer
    Nov 10, 2003
  3. Holger (David) Wagner
    Replies:
    2
    Views:
    1,948
    Holger (David) Wagner
    Jul 3, 2004
  4. Joe
    Replies:
    1
    Views:
    381
    Jeffrey Tan[MSFT]
    Feb 16, 2004
  5. Replies:
    2
    Views:
    542
Loading...

Share This Page