با سلام.
چطور میتونم پسوند های غیر از cshtml رو توی MVC حذف کنم. ممنونم میشم راهنمایی کنید.
منظورتون رو متوجه نشدم
برای مثال یه اکشنی که ویو نداره وقتی اجرا میشه مثلا این آدرس ها پیدا نشد:
view/home/index.cshtm
view/home/index.vbhtm
view/home/index.aspx
یه کاری کنیم که دیگه دنبال اینا به جز cshtml نگرده
کلاس زیر را بعنوان ViewEngin معرفی کنید
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace ClearEnginVB_MVC.App_Start
{
public class CSharpRazorViewEngine : RazorViewEngine
{
public CSharpRazorViewEngine()
{
AreaViewLocationFormats = new[]
{
"~/Areas/{2}/Views/{1}/{0}.cshtml",
"~/Areas/{2}/Views/Shared/{0}.cshtml"
};
AreaMasterLocationFormats = new[]
{
"~/Areas/{2}/Views/{1}/{0}.cshtml",
"~/Areas/{2}/Views/Shared/{0}.cshtml"
};
AreaPartialViewLocationFormats = new[]
{
"~/Areas/{2}/Views/{1}/{0}.cshtml",
"~/Areas/{2}/Views/Shared/{0}.cshtml"
};
ViewLocationFormats = new[]
{
"~/Views/{1}/{0}.cshtml",
"~/Views/Shared/{0}.cshtml"
};
MasterLocationFormats = new[]
{
"~/Views/{1}/{0}.cshtml",
"~/Views/Shared/{0}.cshtml"
};
PartialViewLocationFormats = new[]
{
"~/Views/{1}/{0}.cshtml",
"~/Views/Shared/{0}.cshtml"
};
}
}
}