Design Mode - Retrieve Control's Form Name

M

MLibby

How can I retrieve the form name that contains my web custom control during
design-time? In otherwords, when my control is dragged onto a web form or
user control I want to retrieve the formname.aspx or webusercontrol.ascx that
contains it.

Viewing Page.Site in the debugger at design time shows the following:
property.Page.Site
{Microsoft.VisualStudio.Designer.Host.DesignSite}
[Microsoft.VisualStudio.Designer.Host.DesignSite]:
{Microsoft.VisualStudio.Designer.Host.DesignSite}
Component: {System.Web.UI.Page}
Container: {Microsoft.VisualStudio.Designer.Host.DesignerHost}
DesignMode: true
Name: "WebForm1"

The problem is that the name does not provide a file extension.

Please let me know how to get the full filename and extension.

Mike
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top