logo       

Re: Getting a control's filename and location: msg#00087

windows.devel.dotnet.web

Subject: Re: Getting a control's filename and location

"this.GetType().Name" would give you the name of the ascx file with the "."
replaced "_". If the source ascx is MyControl.ascx then "this.GetType
().Name" would give you "MyControl_ascx". I am not sure if you can find the
actual source path because of shadow copying.

Ayyappan Nair

On Fri, 10 Jun 2005 17:41:19 -0400, Brian Vallelunga <brian@xxxxxxxxxxxxxx>
wrote:

>I'm trying to figure out how to get a user control's filename from
>within the user control itself. The best I could do was:
>
>this.GetType().Assembly.Location
>
>The above only give the location of the currently loaded dll file that's
>in a test directory. I want the original path/name like mycontrol.ascx
>
>Any ideas?
>
>Brian
>
>===================================
>This list is hosted by DevelopMentor® http://www.develop.com
>
>View archives and manage your subscription(s) at http://discuss.develop.com
===================================
This list is hosted by DevelopMentor® http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise