runtime error on page whenever accessed from a subdomain?

A

Andy B

I have a default.aspx file that keeps giving me some problems. Whenever I
access it from www.eternityrecords.org/inhim/default.aspx it works fine. Any
time I access it through the http://inhim.eternityrecords.org domain name
that is mapped to that file, I get runtime error? Any idea what might be the
problem? The server is complaining about the code below (line 1 to be more
exact) and I cant figure out why since 90% of this code is created by the
designer. Any idea how to fix?

<%@ Page Language="C#" MasterPageFile="~/Layout.master"
AutoEventWireup="true" CodeFile="default.aspx.cs" Inherits="InHim_index"
Title="Eternity Records - In Him" %>

<asp:Content ID="Content1" runat="server"
ContentPlaceHolderID="ContentPlaceHolder1">

<h1 style="text-align: center">

Eternity Records presents</h1>

<span style="font-size: 14pt; color: darkred">In Him

<br />

</span>
 
M

Michael Nemtsev [MVP]

Hello Andy,

what's the error ?

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


AB> I have a default.aspx file that keeps giving me some problems.
AB> Whenever I access it from www.eternityrecords.org/inhim/default.aspx
AB> it works fine. Any time I access it through the
AB> http://inhim.eternityrecords.org domain name that is mapped to that
AB> file, I get runtime error? Any idea what might be the problem? The
AB> server is complaining about the code below (line 1 to be more exact)
AB> and I cant figure out why since 90% of this code is created by the
AB> designer. Any idea how to fix?
AB>
AB> <%@ Page Language="C#" MasterPageFile="~/Layout.master"
AB> AutoEventWireup="true" CodeFile="default.aspx.cs"
AB> Inherits="InHim_index" Title="Eternity Records - In Him" %>
AB>
AB> <asp:Content ID="Content1" runat="server"
AB> ContentPlaceHolderID="ContentPlaceHolder1">
AB>
AB> <h1 style="text-align: center">
AB>
AB> Eternity Records presents</h1>
AB>
AB> <span style="font-size: 14pt; color: darkred">In Him
AB>
AB> <br />
AB>
AB> </span>
AB>
 
A

Andy B

Dont have any idea what the error is. I had somebody tell me it isnt working
because of the fact that I am trying to make a sub domain go to an extension
of an existing website and that I needed to create a new asp.net application
or website and publish it to the subfolder the domain points to. I tried
everything physically possible and nothing works. All I get is a runtime
error and the only thing the server admin can tell me is that he sees that
default.aspx has an error on line 1 but wont tell us exactly what the error
is.
 
G

Guest

Dont have any idea what the error is. I had somebody tell me it isnt working
because of the fact that I am trying to make a sub domain go to an extension
of an existing website and that I needed to create a new asp.net application
or website and publish it to the subfolder the domain points to. I tried
everything physically possible and nothing works. All I get is a runtime
error and the only thing the server admin can tell me is that he sees that
default.aspx has an error on line 1 but wont tell us exactly what the error
is.

What directory is the application root?
 
A

Andy B

At this point the main application (website) is in / and the subdomain
application is in Band/. I created a whole different solution in vs2005 and
made a whole new website with a 3mb database just to tell it to allow public
users on the pages. There is also only 2 pages in this website other than
the masterpage used in the root application. I did get it to work this way
but it seems like it is really time and energy consuming having to make a
whole new website just for 2 pages. Is there a simpler way of doing this?
 
G

Guest

users on the pages. There is also only 2 pages in this website other than
the masterpage used in the root application. I did get it to work this way

It is not very clear for me, sorry. Do you mean that ~/Layout.master
is from the "root" application?

I don't know how you did redirected inhim.eternityrecords.org to
www.eternityrecords.org/inhim/ but in general, you should create a new
website on IIS with a new host header as inhim.eternityrecords.org and
point that website either to a separated directory e.g. c:\websites
\inherim or to a directory below "root", e.g. c:\websites\wwwroot
\inherim. In both cases you should have an application there deployed.
 
A

Andy B

Ok. Let me try to clear the problem up a little more so it is a little more
understandable. Just to let you know first of all, I am not the IIS admin
for the server. It is a web farm if you want to put it that way. Now, I have
the website www.eternityrecords.org that I wanted to create in my server
space. I figured / (the server space root) would be good for it and the
pages. Part of this website had the folder "InHim" in it. This folder had 2
pages in it originally: Bio.aspx and index.aspx. After I created the
website, It was determined that there should be a subdomain called
www.inhim.eternityrecords.org that pointed to the "InHim" folder of the
website. This is where I am running into problems. I have pointed the
subdomain there and ended up with runtime errors, access denied for
application problems, page can't be found and I even ended up with the
default place marker text in the compiled page.

I finally resorted to taking and creating a new vs2005 solution to create
the new subdomain. I added new items to the new project (layout.master,
bio.aspx and index.aspx) along with all of its supporting files. After that
I made sure that it was usable by the public on the internet (asp.net
configuration tool>security>authentication). This created aspnet.mdf in the
app_data folder of this new website which is about 3mb in size. I took the
copy of Layout.master that I made and changed the links in the Menu to point
to www.eternityrecords.org/(filename) instead of just ~/(filename). I tried
the ~/(filename) idea but it didn't work for some reason either. As far as
the main website's version of Layout.master, I left alone since there was no
real need to change it. Either way, this last way of doing things worked,
but there has to be an easier and better way of doing this. Hope this helps
as far as whats going on. BTW the "InHim" folder has changed to a new one
since there were issues with it before (the server wouldn't let the admin
delete it even). Otherwise everything is still the same.
 
G

Guest

I finally resorted to taking and creating a new vs2005 solution to create
the new subdomain. I added new items to the new project (layout.master,
bio.aspx and index.aspx) along with all of its supporting files. After that
I made sure that it was usable by the public on the internet (asp.net
configuration tool>security>authentication).

This is correct.

The ~/(filename) was not working under subdomain because (~)
represents the root directory of the application in ASP.NET and when
inhim.eternityrecords.org is pointed to the directory below wwwroot
you cannot refer to a parent dir. This is the reason why you need to
have the separated application for the subdomain.
 
G

Guest

This is correct.

The ~/(filename) was not working under subdomain because (~)
represents the root directory of the application in ASP.NET and when
inhim.eternityrecords.org is pointed to the directory below wwwroot
you cannot refer to a parent dir. This is the reason why you need to
have the separated application for the subdomain.

I think another approach could be following.

1) Point inhim.eternityrecords.org to the same website (adding a host
record in IIS).
2) Create an HTTP Module to redirect all requests from
inhim.eternityrecords.org/*.aspx to www.eternityrecords.org/inhim/*.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top