Click here to Skip to main content
15,886,617 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Requested URL: /Home/Login


My Code:=

SQL
public ActionResult Login()
       {
           return View();
       }

       [HttpPost]
       [ValidateAntiForgeryToken]
       public ActionResult Login(User u)
       {
           // this action is for handle post (login)
           if (ModelState.IsValid) // this is check validity
           {
               using (ProjectManagementEntities dc = new ProjectManagementEntities())
               {
                   var v = dc.UserMasters.Where(a => a.UserName.Equals(u.UserName) && a.UserPassword.Equals(u.UserPassword)).FirstOrDefault();
                   if (v != null)
                   {
                       Session["LogedUserID"] = v.ID.ToString();
                       Session["LogedUserFullname"] = v.UserName.ToString();
                       return RedirectToAction("Create");
                   }
               }
           }
           return View(u);
       }
Posted

This means the URL is not valid as you may not have registered in the Route.config.cs
Which looks like:-
C#
public static void RegisterRoutes(RouteCollection routes)
       {
           routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

           routes.MapRoute(
               name: "Default",
               url: "{controller}/{action}/{id}",
               defaults: new { controller = "Home", action = "Login", id = UrlParameter.Optional } //As in your case if the Login is default URL.
           );
       }

Please check with this and post back your queries if any.
Thanks
 
Share this answer
 
hey check ... u did not delete any views or master pages or partial pages related to LOGIN from your solution ?
 
Share this answer
 

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