为什么在查看和操作方法存在时出现HTML 404错误?

问题描述 投票:0回答:1

在我的项目中,我在SistemGaleri控制器中添加了操作方法,然后放入相关视图。操作方法名称:GaleriIslemleri查看名称:GaleriIslemleri.cshtml,它位于View / SistemGaleri文件夹中

    public ActionResult GaleriIslemleri()
    {
        var sistemGaleriDosyaAramaKriter = new SistemGaleriDosyaAramaKriter();
        try
        {

        }
        catch (Exception ex)
        {
            //HelperUtils.CmsLogger.Error(ex, "Duyuru/Liste");
        }


        return View();
    }
c# model-view-controller view http-status-code-404 action
1个回答
0
投票
 public class RouteConfig
{
    public static void RegisterRoutes(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

        routes.MapRoute(
            name: "Default",
            url: "{controller}/{action}/{query}",
            defaults: new { controller = "AnaSayfa", action = "Index", query = UrlParameter.Optional }
        );

        routes.MapRoute(
            name: "Dosya",
            url: "{controller}/{action}/{Id}/{query}",
            defaults: new { controller = "Home", action = "Index", query = UrlParameter.Optional },
            constraints: new { Id = "\\d+" }
        );
        routes.MapRoute(
     name: "Dosya Duzenle History",
     url: "{controller}/{action}/{query}/{ishistory}/{Id}",
     defaults: new { controller = "Dosya", action = "DosyaDuzenle", ishistory = UrlParameter.Optional, query = UrlParameter.Optional },
       constraints: new { Id = "\\d+" }
 );

        routes.MapRoute(
            name: "Dosya Versiyon Ekle",
            url: "{controller}/{action}/{Id}/{query}/{ParentRaporId}",
            defaults: new { controller = "Dosya", action = "DosyaVersiyonEkle", query = UrlParameter.Optional },
            constraints: new { Id = "\\d+", ParentRaporId = "\\d+" }
        );


        routes.MapRoute(
           name: "History",
           url: "{controller}/{action}/{ishistory}/{query}",
           defaults: new { controller = "AnaSayfa", action = "Index", ishistory = UrlParameter.Optional, query = UrlParameter.Optional }
       );

        routes.MapRoute(
           name: "raporPaylasim",
           url: "{controller}/{action}/{kod}/{tarih}/{optional}",
           defaults: new
           {
               controller = "Rapor",
               action = "RaporPaylasim"
               ,
               kod = UrlParameter.Optional
               ,
               tarih = UrlParameter.Optional
               ,
               optional = UrlParameter.Optional
           }
           ///, constraints: new { kategoriKod = "[a-zA-Z0-9._-]+" }
       );
    }
}

@ vasily.lib你可以查看我的配置文件

© www.soinside.com 2019 - 2024. All rights reserved.