asp.net mvc 3 - RenderPartial renders on Dev but fails on Production server -
i'm calling renderpartial primary view 'user' exists:
@{html.renderpartial("displaytemplates/uinfo", user);} works on dev machine production server tossing runtime error:
the partial view 'displaytemplates/uinfo' not found or no view engine supports searched locations. following locations searched: ...
the following locations searched:
~/views/account/displaytemplates/uinfo.aspx ~/views/account/displaytemplates/uinfo.ascx ~/views/shared/displaytemplates/uinfo.aspx ~/views/shared/displaytemplates/uinfo.ascx ~/views/account/displaytemplates/uinfo.cshtml ~/views/account/displaytemplates/uinfo.vbhtml ~/views/shared/displaytemplates/uinfo.cshtml ~/views/shared/displaytemplates/uinfo.vbhtml my file _is listed - shared/displaytemplates/uinfo.cshtml , works locally.
in case it's relevent - i'm taking liberties of freely switching , forth between razor , legacy .aspx views. concerned possible complications of intermingling 2 point i've tried has worked.
thx
shouldn't be:
@html.displayfor(model => model.user) and if type of model.user uinfo, mvc default in displaytemplates folder , find uinfo.cshtml. mvc convention @ work.
you shouldn't render display templates renderpartial.
if want partial view, this:
@html.partial("somepartial", user)
still, agree behaviour seeing weird , doensn't answer question - try , adhere mvc conventions first , foremost.
Comments
Post a Comment