Posted: April 5, 2011 in Uncategorized

How to redirect a subdomain to a subdirectory?

<%
If InStr( UCase(Request.ServerVariables(“SERVER_NAME”)),  UCase(“subdomain1.YourHostedDomainName.com”) ) > 0 Then
        Response.Redirect(“/subdomain1”)
ElseIf InStr( UCase(Request.ServerVariables(“SERVER_NAME”)), UCase(“subdomain2.YourHostedDomainName.com”) ) > 0 Then
        Response.Redirect(“/subdomain2”)
ElseIf InStr( UCase(Request.ServerVariables(“SERVER_NAME”)), UCase(“subdomain3.YourHostedDomainName.com”) ) > 0 Then
        Response.Redirect(“/subdomain3/home.asp”)
End If
%>

This article demonstrates you how to bind WPF combo box with xml file data or with XmlDataProvider.

Create a Xml file, in my case it is static one but you can create one from the database programmatically.

<?xml version=”1.0″ encoding=”utf-8″ ?>

<companies>

<company name=”Microsoft” />

<company name=”Yahoo” />

<company name=”Atticmedia” />

</companies>

You can add more attributes as per your requirements.

Now goto you app.xaml and add below code in it

<Application.Resources>

<XmlDataProvider x:Key=”Companies” XPath=”/companies” Source=”/DataSource/CompanyData.xml”/>

</Application.Resources>

Declare a combo box on your page as shown below

<ComboBox x:Name=”SelectBox” ItemsSource=”{Binding Source={StaticResource Companies}, XPath=company, Mode=OneTime}” DisplayMemberPath=”@name”>

</ComboBox>

The interesting part here is the DisplayMemberPath property. You must set it in order to view the binded data on your screen.

Hello world!

Posted: January 25, 2011 in Uncategorized

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!