asp.net mvc 3 - cannot convert expression type error in ReturnToAction when calling an action -


while returning action instead of returning view in mvc applicationi getting error: cannot implicitly convert type 'system.web.mvc.redirecttorouteresult' 'system.web.mvc.viewresult'

for example:

public viewresult today()         {             var date = datetime.now;             return view("datetimeview", date);         } public viewresult test()         {             return **redirecttoaction("today");**         } 

i getting error: cannot implicitly convert type 'system.web.mvc.redirecttorouteresult' 'system.web.mvc.viewresult'

change return type of action actionresult instead of viewresult. can this:

public actionresult today()         {             var date = datetime.now;             return view("datetimeview", date);         } public actionresult test()         {             return redirecttoaction("today");         } 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -