Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP.NET MVC - Html.RenderPartial and Html.RenderAction

Reply
Thread Tools

ASP.NET MVC - Html.RenderPartial and Html.RenderAction

 
 
shapper
Guest
Posts: n/a
 
      09-10-2008
Hello,

Consider I have a view named Contact.

When should I use a component (Html.RenderAction) or a partial view
(Html.RenderPartial) to add a "block" to it?

I have been using components and they have their own ViewData ...

But isn't true that I can also include that ViewData into Contact
ViewData and then pass it to the Partial View using
Html.RenderPartial?

So isn't the same?

I am just trying to set some rules of how to decide when develop a new
Html.Helper, use an Html.RenderAction or use an Html.RenderPartial in
my projects ...

Any help is welcome.

Thanks,

Miguel
 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      09-10-2008
its the same decision when choosing between coding a usercontrol (*.asc) and
a real webcontrol (*.cs).

the more you want to package and reuse the code, it the stonger the arg to
use an action rather than loading a usercontrol.


-- bruce (sqlwork.com)


"shapper" wrote:

> Hello,
>
> Consider I have a view named Contact.
>
> When should I use a component (Html.RenderAction) or a partial view
> (Html.RenderPartial) to add a "block" to it?
>
> I have been using components and they have their own ViewData ...
>
> But isn't true that I can also include that ViewData into Contact
> ViewData and then pass it to the Partial View using
> Html.RenderPartial?
>
> So isn't the same?
>
> I am just trying to set some rules of how to decide when develop a new
> Html.Helper, use an Html.RenderAction or use an Html.RenderPartial in
> my projects ...
>
> Any help is welcome.
>
> Thanks,
>
> Miguel
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Save and then display msword documents as html, filtered html, single file .mht or pdf. AAaron123 ASP .Net 1 11-17-2009 09:02 AM
firefox html, my downloaded html and firebug html different? Adam Akhtar Ruby 9 08-16-2008 07:55 PM
Howto Listen html link clicks and change them in STATIC HTML pages..... Aykut Canturk ASP .Net 2 06-04-2008 11:31 AM
Inserting Page Load Times into HTML Source as a HTML Comment ste-m Javascript 1 11-01-2006 02:18 AM
How to send an html message with inline images and text for non html mail clients? John Sutter ASP .Net 0 01-13-2004 07:08 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57