Murugan.com
Murugan Andezuthu Dharmaratnam

  |  HOME   |  BLOG   |  TWITTER   |  ARTICLES   |  8086  |  C++   |  VC++   |  ASP .NET   |  VB .NET   |  JAVA SCRIPT   |  MS SQL   |  PHP   |  MY   |  VIDEOS   |  DOWNLOADS   |  CONTACT ME   |  



Create Mvc view by rendering data from differenet action methods


Home  > ASP.NET  > MVC  > Create Mvc view by rendering data from differenet action methods 
       
How to create a view where data is rendered from different action methods. or where the data comes from different action methods. 

Eg. I am building a community portal. I have data from different areas like, News, Weather , Flight Information etc in the home page. If these data are
returned by differnt action methods how do I update them in HomeControllder Index.aspx.

Here U go the solution. 

Lets Call HomeController the Parent and Index the parent view. 

There are 3 Child Action Methods. 

News
Weather
FlightInfo

Which returnds HTML Data. 


These are the methods. 
public ActionResult News()
{
    return View("
Hot News"); } public ActionResult Weather() { return View("
  • Chicago 10dc
  • "); } public ActionResult News() { return FlightInfo("Something Is going on in America"); } <%= Html.Action("News") %> or <% Html.RenderAction("News"); %> To render news. Can do same for others. IF U WANT JUST ONE ACTION METHOD. AND RETURN RESPECTIVE HTML ON RECEIGING PARAMTER THIS IS WHAT U DO public ActionResult Display(string section) { return View(section); } <% Html.RenderAction("News",new { section = "News" }); %>
    index

    mvc combobox ajax

    What is MVC

    MVC design pattern

    Advantages of an MVC Based Web Application

    Advantages of a Web Forms Based Web Application

    Features of the ASP.NET MVC Framework

    common used mvc namespace or mvc classes

    mvc ActionLink return value from a textbox

    MVC What does controller do

    mvc how http request is processed

    mvc Action Methods

    MVC Return Types of mvc function or Action Retrun Types of an Action Method

    mvc NonActionAttribute

    MVC Partial Views

    Helper Classes and Members for Rendering Views

    What is MVC ViewDataDictionary

    What is MVC Model

    MVC Routing

    MVC Helper Methods

    mvc ActionLink

    mvc routeValues

    mvc what is reflection

    asp net mvc passing data between controllers views and action methods

    Create Mvc view by rendering data from differenet action methods

    asp.net mvc dropdownlist example

    How to publish MVC Application on web

    mvc dropdownlist get selected text

    asp .net mvc populate a dropdownlist from DataSet

    asp .net mvc create a list selectlist from DataSet

    asp .net mvc select options dropdownlist

    Works on local machine System.ArgumentException Format of the initialization string does not conform to specification starting at index

    mvc session timeout

    iis mvc displays directory list and not application

    iis mvc HTTP Error 50019 Internal Server Error section is locked at a parent level overrideMode

    iis mvc error Could not load file or assembly System.Web.Mvc Version 2.0.0.0

    SETTING UP THE DATABASE FOR MEMBERSHIP AUTHENTICATION IN MVC

    One or more validation errors were detected during model generation

    mvc authorize attribute does not store persist post data

    asp .net mvc captcha

    mvc Class Persistance Postback

    Charts & Graphs Jquery plugin

    Html.EditorFor Adding HTML Attributes



      |  HOME   |  BLOG   |  TWITTER   |  ARTICLES   |  8086  |  C++   |  VC++   |  ASP .NET   |  VB .NET   |  JAVA SCRIPT   |  MS SQL   |  PHP   |  MY   |  VIDEOS   |  DOWNLOADS   |  CONTACT ME   |  

    Copyright 2009 @ Murugan Andezuthu Dharmaratnam