How to get the path to a Nancy Razor view inside a view? -
i trying write extension method used inside razor view file path said view.
i have tried putting extension method on htmlhelpers<t>
, nancyrazorviewbase
cannot seem correct information view or render context e.g.
public static string getpath(this nancyrazorviewbase view) { //is null, expecting c:\app\views\index.cshtml return view.path; } <input type="hidden" value="@this.getpath()"/>
is possible path current view inside view?
i using nancy 0.23.
i had overlooked properties on negotiationcontext
e.g. view.rendercontext.context.negotiationcontext.viewname
.
Comments
Post a Comment