Hi every body.
I build a mvc3 site and published on server.my site for months work fine. But recently they did some changes on the host and upgraded it.I published my site again on host.I can see Index file on first page but when I try to login get this error:
Server Error
404 - File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.
After login it must redirect to Index file again. this error not appear on global Error page And also I have this file on host.after that when I redirect again to to my site I see login is done and I can see Admin pages.
this my Login method:
[HttpPost]
public ActionResult LogOn(LogOnModel model, string returnUrl)
{
if (ModelState.IsValid)
{
if (Membership.ValidateUser(model.UserName, model.Password))
{
FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe);
if (Url.IsLocalUrl(returnUrl) && returnUrl.Length > 1 && returnUrl.StartsWith("/")
&& !returnUrl.StartsWith("//") && !returnUrl.StartsWith("/\\"))
{
return Redirect(returnUrl);
}
else
{
return RedirectToAction("Index", "Home");
}
}
else
{
ModelState.AddModelError("", "wrong username or pass ");
}
}
return View(model);
}
but for other pages in my site I have no problem.I can negative to them.this is my global.asax RegisterRoutes code:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default",
"{controller}.mvc/{action}/{id}",
new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
routes.MapRoute(
"Root",
"",
new { controller = "Home", action = "Index", id = "" }
);
}
Where is my problem?
thanks.