Index.chtml page itself i have this link
@Html.ActionLink("Edit","EditUserProfile",new {vchUserID = item.vchUserID})
Inside user Controller itself
// GET: /User/ViewUserProfile/1
public ActionResult EditUserProfile(string userID = "abdul@kareems.com")
{
LIVE_USER objUserFind = db.LIVE_USER.Find(userID);
if (objUserFind == null)
{
return HttpNotFound();
}
return View(objUserFind);
}
//
//POST: /Admin/EditAdminProfile/1
[HttpPost]
public ActionResult EditUserProfile(LIVE_USER objUserFind)
{
if (ModelState.IsValid)
{
db.Entry(objUserFind).State = EntityState.Modified;
db.SaveChanges();
return RedirectToAction("Index");
}
return View(objUserFind);
}
RouteConfig.cs file itself i have url structure like bellow.
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{vchUserID}",
defaults: new { controller = "Admin", action = "Index", vchUserID = UrlParameter.Optional /*kareem removed vchUserID = UrlParameter.Optional*/ }
);
Result i got is: *HTTP Error 404.0 - Not Found The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.*