c# - How to return ActionResult with specific View (not the controller name) -
c# - How to return ActionResult with specific View (not the controller name) -
i have method sendmail in mvc controller.this method calls other method validatelogin. signature of validate login:
private actionresult validatelogin(models.resetpassword model)
when phone call validatelogin sendmail, exception appears because controller seek search view sendmail, want load resetpassword view:
global error - view 'sendmail' or master not found or no view engine supports searched locations. next locations searched: ...
this code of sendmail:
public actionresult sendmail(string login) { homecoming validatelogin(login); }
how can override view on homecoming statement?
thanks in advance
the view
method has overload string viewname
. want pass string
model , asp.net framework confuses trying find view value string
. seek this:
public actionresult sendmail(string login) { this.model = login; // set model homecoming view("validatelogin"); // reponse validatelogin view }
c# asp.net-mvc asp.net-mvc-4
Comments
Post a Comment