What is the use of @html.partial (& ldquo; _somepage & rdquo;) in MVC

advertisements

what is the usage of@html.partial("_somepage") in mvc Framework

It is used for code reusage or some other


If you are given this format it takes like a link to another page or another link.partial view majorly used for renduring the html files from one place to another.

Html.RenderPartial() is a void method - you can check whether a method is a void method by placing your mouse over the call to RenderPartial in your code and you will see the text (extension) void HtmlHelper.RenderPartial...

Void methods require a semicolon at the end of the calling code.

In the Webforms view engine you would have encased your Html.RenderPartial() call within the bee stings <% %>

like so

<% Html.RenderPartial("Path/to/my/partial/view"); %> when you are using the Razor view engine the equivalent is

@{Html.RenderPartial("Path/to/my/partial/view");}