Skip to main content

Making Sense of ASP.NET Paths

Nice article found on the following path about Asp.Net Paths.

Ref: http://weblog.west-wind.com/posts/2009/Dec/21/Making-Sense-of-ASPNET-Paths


Request Property Description and Value
ApplicationPath Returns the web root-relative logical path to the virtual root of this app.
/webstore/
PhysicalApplicationPath Returns local file system path of the virtual root for this app.
c:\inetpub\wwwroot\webstore
PhysicalPath Returns the local file system path to the current script or path.
c:\inetpub\wwwroot\webstore\admin\paths.aspx
Path
FilePath
CurrentExecutionFilePath
All of these return the full root relative logical path to the script page including path and scriptname. CurrentExcecutionFilePath will return the ‘current’ request path after a Transfer/Execute call while FilePath will always return the original request’s path.
/webstore/admin/paths.aspx
AppRelativeCurrentExecutionFilePath Returns an ASP.NET root relative virtual path to the script or path for the current request. If in  a Transfer/Execute call the transferred Path is returned.
~/admin/paths.aspx
PathInfo Returns any extra path following the script name. If no extra path is provided returns the root-relative path (returns text in red below). string.Empty if no PathInfo is available.
/webstore/admin/paths.aspx/ExtraPathInfo
RawUrl Returns the full root relative URL including querystring and extra path as a string.
/webstore/admin/paths.aspx?sku=wwhelp40
Url Returns a fully qualified URL including querystring and extra path. Note this is a Uri instance rather than string.
http://www.west-wind.com/webstore/admin/paths.aspx?sku=wwhelp40
UrlReferrer The fully qualified URL of the page that sent the request. This is also a Uri instance and this value is null if the page was directly accessed by typing into the address bar or using an HttpClient based Referrer client Http header.
http://www.west-wind.com/webstore/default.aspx?Info
Control.TemplateSourceDirectory Returns the logical path to the folder of the page, master or user control on which it is called. This is useful if you need to know the path only to a Page or control from within the control. For non-file controls this returns the Page path.
/webstore/admin/

Comments

Popular posts from this blog

How to post a dynamic form using json data?

// Post dynamic form using json data   function post(uri, data, method) { // when method not provided use default post method method = method || "post" ;     var form = document.createElement( "form" ); form.setAttribute( "method" , method); form.setAttribute( "action" , uri); for ( var property in data) {   if (params.hasOwnProperty(property)) {     var hiddenField = document.createElement( "input" );     hiddenField.setAttribute( "type" , "hidden" );     hiddenField.setAttribute( "name" , property);     hiddenField.setAttribute( "value" , data[property]);      form.appendChild(hiddenField);   } } document.body.appendChild(form); form.submit(); }

Mapping .NET Data Types to MySQL Data Types

Mapping .NET Data Types to MySQL Data Types .NET Data Types MySQL Data Types System.Boolean boolean, bit(1) System.Byte tinyint unsigned System.Byte[] binary, varbinary, blob, longblob System.DateTime datetime System.Decimal decimal System.Double double System.Guid char(36) System.Int16 smallint System.Int32 int System.Int64 bigint System.SByte tinyint System.Single float System.String char, varchar, text, longtext System.TimeSpan time DateTimeOffset type is not supported.

C# - How to get Property Name and Value of a dynamic object?

C# - Dynamic Object Use the following code to get Name and Value of a dynamic object's property. dynamic d = new { Property1= "Value1", Property2= "Value2"}; var properties = d.GetType().GetProperties(); foreach (var property in properties) {     var PropertyName= property.Name; //You get "Property1" as a result     var PropetyValue= d.GetType().GetProperty(property.Name).GetValue(d, null); //You get "Value1" as a result // you can use the PropertyName and Value here  }