tags:

views:

158

answers:

2

I am having trouble getting my ASP.NET application to start an application. For example when I type: http://my.domain.com/virtualdir or

http://my.domain.com/virtualdir/default.aspx

My application will start but I cannot get ASP.NET to start when I type http://my.domain.com.

I have tried to set the default document to default.aspx with no luck. I am sure there is something obvious I a missing here.

+1  A: 

your virtualdir poinst to your web application, so until it is called it won't start. you can redirect http://my.domain.com to http://my.domain.com/virtualdir, so Default.aspx will be requested. But don't forget to set Default.aspx as a file can be served as homepage

erdogany
thanks for the tip. it put me in the right direction
MikeJ
+1  A: 

If you have a an application in a directory (application) called virtualdirectory, then the URL of your application is http://my.domain.com/virtualdirectory/.

However, if you want to use http://my.domain.com/ as your start URL you need to

Method 1

Move everything from C:\Inetpub\wwwroot\virtualdirectory to C:\Inetpub\wwwroot\

I'ld only recommend this course of action if this is the only application you have, or if this is the core application.

Method 2

OR you could try changing the home / root direcory

Method 3

OR you could create a file called c:\inetpub\wwwroot\default.aspx

and stick this in

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="Portal.App.WebForm2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
<script runat="server">
protected void Page_Load(object sender, EventArgs e) {
Server.Transfer("virtualdirectory/default.aspx");

// or 
// Response.Redirect("http://my.domain.com/virtualdirectory/default.aspx");
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>

</div>
</form>
</body>
</html>
DrG
thanks.I found a setting that allows you to make my.domain.com redirect down to the virtual dir so that they end up in the virtual dir if they type http://my.domain.com they get to http://my.domain.com/virtualdir automagically
MikeJ