Problem z działaniem strony ASP.NET MVC3 na serwerze studentlive.

0

Witam, wrzuciłem stronę na studentlive.pl i połączenie z bazą działa (działa logowanie), natomiast wyrzuca error 404 przy wszystkich stronach oprócz INFO... Jak ustawiłem w webconfigu opcje wyświetlania błędów to rzuciło mi:

The page cannot be displayed because an internal server error has occurred.

Próbowałem też zmieniać w Global.asax interpretacje ścieżki z {controller}/{action} na {controller}.aspx/{action} itp. - nie pomogło.

Kiedy zamieściłem HelloMVC3 to działa... Dodam, że moja strona (tak która teraz jest pod adresem: pm.studentlive.pl lokalnie działa)...

W czym może być problem?

0

Znajomy jak stawiał stronę Asp Mvc na studentlivie musiał załatwiać coś z adminami by przestawili parę ustawień. Możliwe , że tutaj jest problem. Wyślij im maila.

PS : Wieczorem postaram też dorzucić ci dokładne info co robili.

0

A co masz w Default.aspx.cs?

0

mam Global.asax.cs a w nim:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using System.Data.Entity.Database;  // DbDatabase.SetInitialize
using ProjectManager.Models;              // MovieInitializer

namespace ProjectManager
{
    // Note: For instructions on enabling IIS6 or IIS7 classic mode, 
    // visit http://go.microsoft.com/?LinkId=9394801

    public class MvcApplication : System.Web.HttpApplication
    {
        public static void RegisterGlobalFilters(GlobalFilterCollection filters)
        {
            filters.Add(new HandleErrorAttribute());
        }

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
		
            routes.MapRoute(
                "Default", // Route name
                "{controller}/{action}/{id}", // URL with parameters
                new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
            );
        }

        protected void Application_Start()
        {
            //DbDatabase.SetInitializer<ProjectManagerEntities>(new DataContextInitializer());
            //DbDatabase.SetInitializer<NewsDBContext>(new NewsContextInitializer());

            AreaRegistration.RegisterAllAreas();

            RegisterGlobalFilters(GlobalFilters.Filters);
            RegisterRoutes(RouteTable.Routes);
        }
    }
}
0

Gratuluję. :)

Ale ja pytam o Default.aspx.cs. Na IIS 7 w "Integrated mode" nie jest on potrzebny, ale w "Classic mode" oraz na starszych wersjach jest niezbędny, żeby IIS zakumał, że to MVC. A w szablonie projektu nie ma chyba domyślnie tego pliku.

Default.aspx:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ModulAdministracyjny._Default" %>

<%-- Please do not delete this file. It is used to ensure that ASP.NET MVC is activated by IIS when a user makes a "/" request to the server. --%>

Default.aspx.cs:

using System.Web;
using System.Web.Mvc;
using System.Web.UI;

namespace ModulAdministracyjny
{
    public partial class _Default : Page
    {
        public void Page_Load(object sender, System.EventArgs e)
        {
            HttpContext.Current.RewritePath(Request.ApplicationPath, false);
            IHttpHandler httpHandler = new MvcHttpHandler();
            httpHandler.ProcessRequest(HttpContext.Current);
        }
    }
}

Nie gwarantuję, że o to chodzi, po prostu tak strzelam.

0

niestety nie o to chodzi...

1 użytkowników online, w tym zalogowanych: 0, gości: 1