Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Difference between Html.RenderPartial and Html.Partial

    • 0
    • 2
    • 2
    • 0
    • 0
    • 0
    • 0
    • 0
    • 172
    Comment on it

    "Difference between Html.RenderPartial and Html.Partial"

        Html.RenderPartial and Html.Partial both are the methods to render a Partial View in MVC Razor.

    Following table shows the difference between these two:

    Html.RenderPartial Html.Partial
    It writes the Partial View response directly into http response stream. It returns the html encoded string.
    It writes result directly into the calling object's TextWriter. It uses a separate TextWriter for returning a string.
    The return type is Void. The return type is string that can be stored in a variable.
    Response of this method is faster as it directly writes the response into the response stream. Response is slower as compared to RenderPartial method.
    Syntax is: @{Html.RenderPartial("_partialviewname");} Syntax is: @Html.Partial("_partialviewname")

    Happy Coding..!

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: