user1477388
user1477388

Reputation: 21440

Including one page inside of another in MVC

I know how to create view partials, but I want to show a certain action on a certain controller, like so:

RssController -> ShowRss 
/Rss/ShowRss

I want to show that page inside of this page:

MyBlog -> Index 
/MyBlog

What's the best way to do this, or am I designing this wrong?

Upvotes: 1

Views: 285

Answers (1)

Shyju
Shyju

Reputation: 218852

To include another action method results to your Index view, you can call the Html.Action helper Method inside the Index View of MyBlog

@Html.Action("ShowRss ","Rss")

EDIT : As per the comment

If you do not want the Layout, Set the Layout property value as null in ShowRss view

@{
  Layout=null;
}

Upvotes: 4

Related Questions