yash patel

yash patel

  • 1.4k
  • 282
  • 20.8k

Getting error for page redirect

Oct 2 2020 1:42 AM
This is my action method
  1. public ActionResult DeleteUserDetails( int UserId )  
  2. {  
  3. var temp = objnsrouteEntities.Users.Where(model => model.UserId == UserId).First();  
  4. objnsrouteEntities.Users.Remove(temp);  
  5. objnsrouteEntities.SaveChanges();  
  6. nsrouteEntities obj = new nsrouteEntities();  
  7. List<DataAccess.User> userlist = obj.Users.ToList();  
  8. List<UserAddress> useraddresslist = obj.UserAddresses.ToList();  
  9. var userdata = from u in userlist  
  10. join uad in useraddresslist on u.UserId equals uad.U_Id into table1  
  11. from uad in table1.DefaultIfEmpty()  
  12. select new UserDetails { userdetail = u, useraddressdetail = uad };  
  13. return View("Dashboard","Home", userdata);  
  14. }  
when click on delete button the record is passed in the url and it is getting deleted also
 
but it is not redirecting to the " DASHBOARD " page
 
getting this error
 
Server Error in '/' Application.
The view 'Dashboard' or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/Account/Dashboard.aspx
~/Views/Account/Dashboard.ascx
~/Views/Shared/Dashboard.aspx
~/Views/Shared/Dashboard.ascx
~/Views/Account/Home.master
~/Views/Shared/Home.master
~/Views/Account/Dashboard.cshtml
~/Views/Account/Dashboard.vbhtml
~/Views/Shared/Dashboard.cshtml
~/Views/Shared/Dashboard.vbhtml
~/Views/Account/Home.cshtml
~/Views/Account/Home.vbhtml
~/Views/Shared/Home.cshtml
~/Views/Shared/Home.vbhtml

Answers (1)