Click here to Skip to main content
15,883,901 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
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:
C#
[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:
C#
public static void RegisterRoutes(RouteCollection routes)
{
    routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

    routes.MapRoute(
        "Default", // Route name
        "{controller}.mvc/{action}/{id}", // URL with parameters
        new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
    );

    routes.MapRoute(
    "Root",
    "",
    new { controller = "Home", action = "Index", id = "" }
  );
}


Where is my problem?
thanks.
Posted
Updated 6-Dec-13 7:17am
v4
Comments
Sergey Alexandrovich Kryukov 6-Dec-13 14:03pm    
What "some changes"?! Keep track of all your changes, use some Revision Control System, don't work without proper committing all changes to it...
Find out what exactly is not found, this is not difficult at all. Honestly, you are asking as if we had all your site...
—SA
abbaspirmoradi 6-Dec-13 14:37pm    
I have no change on site.my site exactly same as before exist
Sergey Alexandrovich Kryukov 6-Dec-13 14:43pm    
Oh, "they did"... Then its very confusing. Who are "they" and who are you, who supplies what? Really, nothing is clear...
—SA
abbaspirmoradi 6-Dec-13 14:49pm    
they are my host support team.they upgrade host enviroment, but can you tell me how this can be affect on my site,thanks.
Sergey Alexandrovich Kryukov 6-Dec-13 14:56pm    
Without knowing the content before the change? You must be really desperate... Keep track of your changes, really. Are you the owner of the code or not, after all..?
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900