473,395 Members | 1,558 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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

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
Sep 10 '08 #1
1 5521
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
Sep 10 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: VK | last post by:
09/30/03 Phil Powell posted his "Radio buttons do not appear checked" question. This question led to a long discussion about the naming rules applying to variables, objects, methods and properties...
0
by: Boris Ammerlaan | last post by:
This notice is posted about every week. I'll endeavor to use the same subject line so that those of you who have seen it can kill-file the subject; additionally, Supersedes: headers are used to...
20
by: Al Moritz | last post by:
Hi all, I was always told that the conversion of Word files to HTML as done by Word itself sucks - you get a lot of unnecessary code that can influence the design on web browsers other than...
6
by: Ludwig77 | last post by:
When I was first taught html several years ago, I was taught that the following tags are standard for any html formatted message: <HTML> <HEAD> </HEAD> </BODY> </HTML> In fact, I was taught...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.