Learning and using asp.net mvc for such a long time, or asp.net obsession. Can I show aspx or user control in asp.net mvc?
This inspiration (not the inspiration, but the idea) is from the previous days have written a "multiple view results displayed in a shared preview view" Http://www.cnblogs.com/insus/p/3633298.html There is a render method. So that when you think of the previous development of ASP.net, you often render user controls. That is to say, after render the page, it is converted to a string of strings.
Then we can also return this string to the view of ASP.net mvc.
Looking back, look at the user control (UserControl) http://www.cnblogs.com/insus/tag/UserControl/
Look Htmltextwrite Related: http://www.cnblogs.com/insus/tag/HtmlTextWriter
Under the application, create a new directory Aspnets directory, and add a new aspx and a ascx,insus.net in the demo below, rendering them separately. Simple.
WebForm1.aspx, because it only makes a simple demo, insus.net only pulls one literal control:
WebForm1.aspx.cs, in the Page_Load event, assign a value to the literal control:
The user control, like the ASPX page above, Webusercontrol1.ascx: