I am new to asp.net MVC so please bear with me. I need build a menu that repeats across multiple views. What would better serve the purpose Html.Action OR Html.Partial.
I am new to asp.net MVC so please bear with me. I need build
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here are what I consider my guidelines on using Html.Action or Html.Partial
Html.Partial
Html.Partialwhen you are rendering static content or,Html.Action
Html.Actionwhen you actually need to retrieve additional data from the server to populate the partial viewBasically, if is static, use
Html.Partial(). If dynamic, model independent data, useHtml.Action(). There are probably more scenarios, but this will give you a good idea of where/how to go.Html.RenderPartial()andHtml.RenderAction()are interchangeable for the similarly named functions above.