我有MVC應用程序,我嘗試訪問移動領域。太多的重定向錯誤(ASP.NET MVC)
所以我決定使用集成到chrome移動模式。
我的起動控制器是Account/Login
這裏是ApplicationStart
protected void Application_Start()
{
#if DEBUG
XmlConfigurator.ConfigureAndWatch(new FileInfo(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "logging_DEBUG.config")));
#else
if (AppDomain.CurrentDomain.BaseDirectory.Contains("DevTrackerweb")
|| AppDomain.CurrentDomain.BaseDirectory.Contains("Trackerweb4Test"))
{
XmlConfigurator.ConfigureAndWatch(new FileInfo(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "logging_DEBUG.config")));
}
else
XmlConfigurator.ConfigureAndWatch(new FileInfo(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "logging.config")));
#endif
var log = LogManager.GetLogger(AppDomain.CurrentDomain.BaseDirectory);
log.Info("Application start");
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
ModelBinders.Binders.Add(typeof(decimal), new DecimalModelBinder());
ModelBinders.Binders.Add(typeof(decimal?), new NullableDecimalModelBinder());
Translator.Prefetch().Wait();
HttpContext.Current.Application.Add("TrackerwebServiceStatus", TrackerwebServiceStatus.OK);
sitesByHostName = InitializeSites();
mainCustomerIDByCustomerID = InitializeCustomerIDDictionary();
}
當我運行代碼,我有這個
我怎樣才能解決這個問題?
如何檢查\編輯呢? –
https://stackoverflow.com/questions/9727509/how-to-allow-an-anonymous-user-access-to-some-given-page-in-mvc 例如,像這樣? –
是的,使用'AllowAnonymous'屬性 – Moho