zsharp
zsharp

Reputation: 13766

Can I have nested User Controls in ASPnet mvc?

How would I go about this?

EDIT: USER CONTROL WITHIN USER CONTROL?

Upvotes: 1

Views: 878

Answers (2)

Corin Blaikie
Corin Blaikie

Reputation: 18138

use nested calls to Html.RenderPartial.

i.e. Have Html.RenderPartial in your page1.aspx view to render your usercontrol1.ascx view

that contains another Html.RenderPartial call to render usercontrol2.ascx

Upvotes: 2

Jon Erickson
Jon Erickson

Reputation: 115006

You want to look up Partial Views

here is a link to get you started http://bradwilson.typepad.com/blog/2008/08/partial-renderi.html

Upvotes: 1

Related Questions