asp.net mvc 3 - Error executing child request for handler -
i use child action in home controller this:
[outputcache(duration=30)] public actionresult childaction() { response.write("date time is="+datetime.now); return view(); } home.cshtml <h2>about</h2> <p> @html.action("childaction") </p>
but after run asp.net mvc3.0 project error :
the view 'childaction' or master not found or no view engine supports searched locations. following locations searched:
~/views/home/childaction.aspx ~/views/home/childaction.ascx ~/views/shared/childaction.aspx ~/views/shared/childaction.ascx ~/views/home/childaction.cshtml ~/views/home/childaction.vbhtml ~/views/shared/childaction.cshtml ~/views/shared/childaction.vbhtml
please me how can solve
you should have view named "childaction", or in action should return view as
return view("viewname");
in summary, view name should same action name, not controller name did(you named view "home").
Comments
Post a Comment