System.Web.UI Namespace Control Class
Returns the virtual directory of the Page or UserControl that contains the current server control.
Script |
Control.TemplateSourceDirectory |
This property can only be used programmatically; it cannot be set when declaring the control.
The virtual directory of the page or user control that contains the server control.
The following example shows the simplest way to retrieve and display the TemplateSourceDirectory for the first control on the current Web page.
<%= Page.Controls [ 0 ].TemplateSourceDirectory %>
And which, for this page, returns the following:
/sys
Control Members Page UserControl