Search KB Filter article types
Presentation layers CodeSample - Determine runtime if your application is running over DHTML or Silverlight
Categories: Configuration, Silverlight
Tags: Developers, 1. Beginner, Silverlight, Pre v6.3, v6.3, 2. Intermediate, 3. Advanced
Revision: 1
Posted: 05/Oct/2009
Updated: 23/July/2010
Status: Publish
Types: Article

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

Running multiple presentation layers, then on occasions, there is a need to differenciate between a request from a DHTML client and a request from a Silverlight client

How to do it

You first need to know in code what are the used extensions of both DHTML and Silverlight. This can actually be retrieved directly from web.config, but more convenient is to use the following:

Context.Config.GetFeatureValue("Extension",".wgx")
Context.Config.GetFeatureValue("SilverlightExtension", ".swgx")

Next you need to find out how the client initiated the request.

VWGContext.Current.HttpContext.Request.UrlReferrer.ToString()

Typical response from this request would be

http://localhost/Form1.wgx
From this output, it should be trivial to extract the extension used. Note however, that if your request includes any query parameters, you need to account for them.

About the author

Related Articles

Configuration  
Title Update Author
Visual WebGui version 6.2 features complete integration into the Microsoft Visual Studio development system, a consolidated installation process, and the opportunity to use Microsoft Visual Studio Express Editions for software evaluation and trials. Attend this webcast to learn how the Visual WebGui...
Tags: Developers, Visual WebGui Pipeline, Visual Studio, 1. Beginner, 2. Intermediate, 3. Advanced, Integration, Pre v6.3, v6.3, v6.4 and Later
11/Jan/2008    2008/01/11
Tags: Developers, 2. Intermediate, 3. Advanced, Customization, WCF, Pre v6.3, v6.3, v6.4 and Later
06/Jan/2009    2009/01/06
Tags: Architects, Developers, XML, 1. Beginner, 2. Intermediate, 3. Advanced, Pre v6.3, v6.3, v6.4 and Later
29/Oct/2010    2010/10/29
Tags: Architects, Developers, XML, 1. Beginner, 2. Intermediate, 3. Advanced, Pre v6.3, v6.3, v6.4 and Later
23/July/2010    2010/07/23
Tags: Architects, Developers, XML, 1. Beginner, 2. Intermediate, 3. Advanced, Pre v6.3, v6.3, v6.4 and Later
23/July/2010    2010/07/23
Tags: Architects, Developers, XML, 1. Beginner, 2. Intermediate, 3. Advanced, Pre v6.3, v6.3, v6.4 and Later
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