Search KB Filter article types
HtmlBox CodeSample - URL as file within application
Categories: DHTML, Files, URL
Tags: Architects, Developers, 1. Beginner, 2. Intermediate, 3. Advanced, Pre v6.3, v6.3, v6.4 and Later
Revision: 1
Posted: 12/Oct/2009
Updated: 23/July/2010
Status: Publish
Types: Code

This article will have a few sections added to it soon, based on the following article type skeleton: CodeSample
Overview

When assigning to the URL property a file within the virtual folder of the application, the path must be slightly different depending on if the file is on the root folder, or on a subfolder. This codesample gives you idea on how to make that irrelevant.

VB.NET code
If Context.HttpContext.Request.ApplicationPath.EndsWith("/") Then
    htmlBox1.Url = Context.HttpContext.Request.ApplicationPath & "HTMLPage1.htm"
Else
    htmlBox1.Url = Context.HttpContext.Request.ApplicationPath & "/HTMLPage1.htm"
End If


C# Code
if (Context.HttpContext.Request.ApplicationPath.EndsWith("/") )
{
    htmlBox1.Url = Context.HttpContext.Request.ApplicationPath + "HTMLPage1.htm";
} else {
    htmlBox1.Url = Context.HttpContext.Request.ApplicationPath + "/HTMLPage1.htm";
}

About the author

Related Articles

DHTML  
Title Update Author
The following code integrates google maps into Visual WebGui by creating a GoogleMap control which can be used as any Visual WebGui control.
Tags: Architects, Developers
05/Jan/2007    2007/01/05
Tags: Architects, Developers, 1. Beginner, 2. Intermediate, 3. Advanced, DHTML, v6.3, v6.4 and Later
30/Oct/2010    2010/10/30
Tags: Architects, Developers, 1. Beginner, 2. Intermediate, 3. Advanced, Integration, Pre v6.3, v6.3, v6.4 and Later
14/Nov/2010    2010/11/14
Tags: Architects, Developers, 2. Intermediate, 3. Advanced, Pre v6.3, v6.3, v6.4 and Later
23/July/2010    2010/07/23
Tags: Architects, Developers, 1. Beginner, 2. Intermediate, 3. Advanced, Pre v6.3, v6.3, v6.4 and Later
23/July/2010    2010/07/23
Tags: Developers, 1. Beginner, Integration, Silverlight, Pre v6.3, v6.3, 2. Intermediate, 3. Advanced
23/July/2010    2010/07/23
.NET Web, Cloud and Mobile application delivery platform | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2011 Visual WebGui®       Visual WebGui weblog on ASP.NET Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS