How can I get the path of a Nancy Razor view in a view?


line 1

I'm trying to write an extension method that will be used inside a razor view to get the file path of that view.

I've tried using extension methods HtmlHelpers<T>, NancyRazorViewBasebut I can't seem to get the correct information from the view or rendering context, e.g.

public static string GetPath(this NancyRazorViewBase view)
{
    //Is null, expecting something like C:\app\views\index.cshtml
    return view.Path;
}

<input type="hidden" value="@this.GetPath()"/>

Is it possible to get the path of the current view from inside the view?

I am using Nancy 0.23.

line 1

I ignored the properties on NegotiationContexte.g.view.RenderContext.Context.NegotiationContext.ViewName

Related


How can I get the path of a Nancy Razor view in a view?

line 1 I'm trying to write an extension method that will be used inside a razor view to get the file path of that view. I've tried using extension methods HtmlHelpers<T>, NancyRazorViewBasebut I can't seem to get the correct information from the view or render

How can I get the value of the razor textbox in the same view?

Gaurav Chauhan I'm using @@Html.Textbox("searchString") in a Razor view page. i need to @Html.ActionLink("View Items", "Index", new { id = item.transaction_id, searchString = "Value of textbox"}). Of course, the search string part in the html action link is n

How can I get the value of the razor textbox in the same view?

Gaurav Chauhan I'm using @@Html.Textbox("searchString") in a Razor view page. i need to @Html.ActionLink("View Items", "Index", new { id = item.transaction_id, searchString = "Value of textbox"}). Of course, the search string part in the html action link is n

How can I get the value of the razor textbox in the same view?

Gaurav Chauhan I'm using @@Html.Textbox("searchString") in a Razor view page. I need this value in textbox @Html.ActionLink("View Items", "Index", new { id = item.transaction_id, searchString = "Value of textbox"}). Of course, the search string part in the ht

How can I get the value of the razor textbox in the same view?

Gaurav Chauhan I'm using @@Html.Textbox("searchString") in a Razor view page. i need to @Html.ActionLink("View Items", "Index", new { id = item.transaction_id, searchString = "Value of textbox"}). Of course, the search string part in the html action link is n

How can I get the value of the razor textbox in the same view?

Gaurav Chauhan I'm using @@Html.Textbox("searchString") in a Razor view page. i need to @Html.ActionLink("View Items", "Index", new { id = item.transaction_id, searchString = "Value of textbox"}). Of course, the search string part in the html action link is n

How can I get the value of the razor textbox in the same view?

Gaurav Chauhan I'm using @@Html.Textbox("searchString") in a Razor view page. i need to @Html.ActionLink("View Items", "Index", new { id = item.transaction_id, searchString = "Value of textbox"}). Of course, the search string part in the html action link is n

How can I get the value of the razor textbox in the same view?

Gaurav Chauhan I'm using @@Html.Textbox("searchString") in a Razor view page. i need to @Html.ActionLink("View Items", "Index", new { id = item.transaction_id, searchString = "Value of textbox"}). Of course, the search string part in the html action link is n

How can I get the value of the razor textbox in the same view?

Gaurav Chauhan I'm using @@Html.Textbox("searchString") in a Razor view page. i need to @Html.ActionLink("View Items", "Index", new { id = item.transaction_id, searchString = "Value of textbox"}). Of course, the search string part in the html action link is n

How can I get the value of the razor textbox in the same view?

Gaurav Chauhan I'm using @@Html.Textbox("searchString") in a Razor view page. i need to @Html.ActionLink("View Items", "Index", new { id = item.transaction_id, searchString = "Value of textbox"}). Of course, the search string part in the html action link is n

How can I get the value of the razor textbox in the same view?

Gaurav Chauhan I'm using @@Html.Textbox("searchString") in a Razor view page. i need to @Html.ActionLink("View Items", "Index", new { id = item.transaction_id, searchString = "Value of textbox"}). Of course, the search string part in the html action link is n

Nancy: Razor View Engine @using IntelliSense not working

Ajay I'm having issues with IntelliSense using Nancy and Razor View Engine. I try to use the functionality of a (homemade) external library in a razor view. So I referenced the dll and tried putting @using and namespaces at the top of the view to get some Inte

How to get the path of the view

private I'm looking for a way to get the PATH of a view and use it in the href. For the rest of the links in my .tpl file I use something like: print url('node/36'); How can I mimic this behavior of the view module? I'd like to be able to edit the view's path

How to get the path of the view

private I'm looking for a way to get the PATH of a view and use it in the href. For the rest of the links in my .tpl file I use something like: print url('node/36'); How can I mimic this behavior of the view module? I'd like to be able to edit the view's path

How to get the path of the view

private I'm looking for a way to get the PATH of a view and use it in the href. For the rest of the links in my .tpl file I use something like: print url('node/36'); How can I mimic this behavior of the view module? I'd like to be able to edit the view's path

How can i redirect the page in razor view .cshtml?

ilaaya @{Response.Redirect("Index","Home")}; The above code does not work please help me. Gone Coding Response.Redirectis a server-side operation and makes little sense to use in a view. You are after an appropriate client-side operation. You can simply change

How can I add my own JS to a Razor view?

giraffe I would like to add lines 4-6 in the "scripts" section of the page. I think the code below. instead of writing it to the page. I don't know what I'm doing wrong. This seems like a very uncommon thing to some extent, as I haven't found an example of doi

How can i redirect the page in razor view .cshtml?

ilaya @{Response.Redirect("Index","Home")}; The above code does not work please help me. Gone Coding Response.Redirectis a server-side operation and makes little sense to use in a view. You are after an appropriate client-side operation. You can simply change

(Nancy) Razor View Engine partial view renders full HTML

Frank Witt Using Nancy and Razor view engine, I get the following. I have a view: @inherits Nancy.ViewEngines.Razor.NancyRazorViewBase <!DOCTYPE html> <html> <head> <title></title> </head> <body> @Html.Partial("_PartialPage1")

I can't set breakpoints in razor view

Previous I know it's possible to set breakpoints in MVC Razor views, but something went wrong and it doesn't work anymore. I tried to restart Visual Studio 2013 and change some debugging options. What do you recommend? Previous Thanks to Vladimir, I found the

I can't set breakpoints in razor view

move forward I know it's possible to set breakpoints in MVC Razor views, but something went wrong and it doesn't work anymore. I tried to restart Visual Studio 2013 and change some debugging options. What do you recommend? move forward Thanks to Vladimir, I fo

I can't set breakpoints in razor view

Previous I know it's possible to set breakpoints in MVC Razor views, but something went wrong and it doesn't work anymore. I tried to restart Visual Studio 2013 and change some debugging options. What do you recommend? Previous Thanks to Vladimir, I found the

How can I get the view like this:

Hussein Bebdi Ladd I use the following code to transfer from my mainViewController to another UIViewController: UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:otherUiViewController]; UIWindow *window =