Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
611 views
in Technique[技术] by (71.8m points)

asp.net - I am getting a blank page while deploying MVC application on IIS

I am currently deploying my application built using RC of MVC ASP.NET on the production server which is showing nothing now. The routes in my global.ascx are typical i.e.

routes.MapRoute(
            "Default",                                              // Route name
            "{controller}.aspx/{action}/{id}",                           // URL with parameters
            new { controller = "Home", action = "Index", id = "" }  // Parameter defaults
        );
        routes.MapRoute(
          "Root",
          "",
          new { controller = "Home", action = "Index", id = "" }
        );

Can any one figure out why it is showing me only blank pages

Sorry i forget to mention the it is IIS 6

Interestingnly it is also working on my local IIS (i.e. both local built in with VS & standard with XP) as well

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You will also get a blank page when you have error handling setup in your global.asax and something generic is wrong (like an assembly that could not be found).

When you disable it in the global.asax, you can see the server error. Don't forget to enable it again after fixing those initial bugs.

protected void Application_Error(object sender, EventArgs e)
{
    Exception exception = Server.GetLastError();
    RouteData routeData = new RouteData();
    routeData.Values.Add("controller", "ErrorController");
    routeData.Values.Add("action", "HandleTheError");
    routeData.Values.Add("error", exception);

    Response.Clear();
    Server.ClearError();

    IController errorController = new ErrorController();
    errorController.Execute(new RequestContext(
        new HttpContextWrapper(Context), routeData));
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...