asp.net.ph

Control.AppRelativeTemplateSourceDirectory Property

System.Web.UI Namespace   Control Class


.NET Framework version 2.0

Sets or retrieves the application-relative virtual directory of the Page or UserControl object that contains this control.

Syntax


Script Control.AppRelativeTemplateSourceDirectory [ = strVirtualDir ]

This property can only be used programmatically; it cannot be set when declaring the control.

Property Value


strVirtualDir The application-relative virtual directory of the page or user control that contains this control.

The property is read/write with no default value.

Remarks

The AppRelativeTemplateSourceDirectory property contains the application-relative path to the page or user control that contains the current control. For example, if the control is on a Web page that resides at

http://authors.aspalliance.com/sys

the AppRelativeTemplateSourceDirectory property returns "~/sys/".

To return the virtual path, use the TemplateSourceDirectory property.

Example

The following example shows the simplest way to retrieve and display the AppRelativeTemplateSourceDirectory for the first control on the current Web page.

<%= Page.Controls [ 0 ].AppRelativeTemplateSourceDirectory %>

And which, for this page, returns the following:

~/sys/

See Also

Control Members   Page   UserControl Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph