If you look for documentation regarding rendering a Partial View in ASP.NET MVC, unfortunately, most of the links will point to StackOverflow forum threads.
This becomes a mixed bag of answers, so it may take numerous threads before you discover the right solution!
If you just type @Html.RenderPartial, then you will end up with the following error in Visual Studio:
Since so many Html Helpers just work this way, the actual answer to using the RenderPartial Html Helper is a bit more elusive:
As you can tell from the code sample, the RenderPartial Html Helper needs to be surrounded by curly braces ({...}). After you do this, your RenderPartial Html Helper will work correctly!
This becomes a mixed bag of answers, so it may take numerous threads before you discover the right solution!
If you just type @Html.RenderPartial, then you will end up with the following error in Visual Studio:
Since so many Html Helpers just work this way, the actual answer to using the RenderPartial Html Helper is a bit more elusive:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@{Html.RenderPartial("_myPartialView");} | |
@{Html.RenderPartial("_myPartialView", Model);} |
No comments:
Post a Comment