473,503 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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

Sep 29 '06 #1
1 2687

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
Sep 29 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1820
by: Andreas Neudecker | last post by:
Hi. I know you can read the filename of a program as sys.argv. But what about modules? Is there a similar way to find out the file name of a module (called by some other module or program) from...
3
448
by: Jim | last post by:
I have derived of DataGrid to give functionality of an expandable dataGrid (similar to article in October2003 MSDN). I have override the LoadStateView and SaveStateView to save the extra properties...
1
1208
by: Rob Meade | last post by:
Hi all, Still very new to ASP.Net so please bare with me. I have created several .ascx controls which I have dragged and dropped onto my page in a table, looks very nice - each of the controls...
6
2764
by: tshad | last post by:
I have an ascx file I am using to include my logos and heading information for all my pages. It was working fine up until now. I decided to set up an admin folder inside of my main folder and...
2
1693
by: Gopalan | last post by:
Hi I was using <link href="...." type="..."> tag inside the .aspx file. When I converted this aspx file to ascx file and use it in an aspx file it is not working properly. Please tell me...
0
1190
by: ahcirlko | last post by:
I am using different user controls in same page. I have a function inside of the .ascx file. How can I call it from another .ascx file Language C#
0
1233
by: mpl | last post by:
Hi, i have an ascx file haivng code like <asp:LinkButton ID="col" runat="server" Text='<%# Eval("8Y") %>' OnClick="ColSelected" /> now i am using code behind implmentation for ColSelected.I...
7
11885
by: mpl | last post by:
Hi, i have an ascx file(web control file ) haivng code like <asp:LinkButton ID="col" runat="server" Text='<%# Eval("8Y") %>' OnClick="ColSelected" /> now i am using code behind implmentation...
2
3004
by: mpl | last post by:
Hi, i have an ascx file named mytestcontrol.ascx. it has reference to another ascx control as below. <%@ Register Src="myControl.ascx" TagName="myControl" TagPrefix="uc" %> .... .........
0
7083
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7278
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7328
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7456
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3153
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1510
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
379
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.