Home » Asp.net

404 error when uploaded

Hi all

I have been building a site and it works fine locally but i get a 404 and it redirects to the generic error page when i upload it to FastHosts.

I contacted them and they say they think its a scripting error on my part.I dont even know where to look because ive not got any indication as to what could be the problem.

If any of you could help i would be very grateful.

The web.config looks like this ...

<?xml version="1.0"?>
    Note: As an alternative to hand editing this file you can use the 
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in 
    machine.config.comments usually located in 
  <add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\OakmanDesign.mdf;Integrated Security=True;User Instance=True"
   providerName="System.Data.SqlClient" />
            Set compilation debug="true" to insert debugging 
            symbols into the compiled page. Because this 
            affects performance, set this value to true only 
            during development.
		<compilation debug="false" targetFramework="4.0">
            The <authentication> section enables configuration 
            of the security authentication mode used by 
            ASP.NET to identify an incoming user. 
		<authentication mode="Windows"/>
            The <customErrors> section enables configuration 
            of what to do if/when an unhandled error occurs 
            during the execution of a request. Specifically, 
            it enables developers to configure html error pages 
            to be displayed in place of a error stack trace.
        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
		<pages theme="MainTheme" styleSheetTheme="MainTheme" controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
        The system.webServer section is required for running ASP.NET AJAX under Internet
        Information Services 7.0.  It is not necessary for previous version of IIS.

If you need any more information, let me know and i will happily provide it.

Thanks in advance



7 Answers Found


Answer 1

In web.config, customerrors part, you may try to get the mode  on and see what happens:

<customErrors defaultRedirect="ErrorPage.aspx" mode="On">   
    <error statusCode="500" redirect="servererror.aspx" />
    <error statusCode="404" redirect="filenotfound.aspx" />
    <error statusCode="403" redirect="AccessDenied.aspx" /> 




Answer 2

Is it the default home page  or some other page that is causing the error?  If you're having problems with the home page, check in IIS to see if Enable Default Content is selected and take a look at the documents listed for default content.  Edit the list  if the name of your home page isn't included, and move it to the top of the list.


Answer 3


How did you deploy your ASP.NET site? Also it seems that you use ASP.NET 4.0, but FastHosts support ASP.NET 3.5 with their shared Windows hosting plans.



Answer 4

It brings up the servererror.aspx when i add the error  500 message. 

@SparTodd - Its on a remote host so i dont have direct access to their IIS (The site  works fine  locally)


Im pretty sure thats the problem  is that im using 4. However when i try to change it to 3.5 i get all kinds of problems and the site stops working locally.


Answer 5

Hi all

Ok i have got it partly solved. I changed the site  to 3.5 and, due to the host not supporting  HttpHandlers or modules in the web.config i removed them and the pages  work.

However my next problem  is that i built the site in VS 2010 and to create a database in that is to create an mdf file (or at least thats the only way i know how to do it) but my host doesnt support MDF files.

So i have to create a SQL database. I have created the MDF file but im not sure how to set up SQL server on my machine  and more importantly how to import the data from the MDF file into a SQL database so i can put that onto my site.

Is anyone able to help  me with that?

Sorry for all the questions


Answer 6

Open Management Studio, attach mdf file to a database.

If godaddy provide  database restore tool in their control panel, backup your database (.bak file) and restore to hosting server.

You can also request  the host to attach mdf file for you to a MSSQL database.


Answer 7


Im actually using FastHosts (did i mention goDaddy because i am dealing with them with another site)

Thankyou all for your replies, i have managed to resolve the issue.

I apreciate the time people took to help  me.




<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure