views:

56

answers:

2

I'm trying emulate the IE Webcontrols Pageview system.

Basically I have

<c:Multipage> <c:pageview>

[Block of ASP.NET / HTML]

</c:pageview> (More pageviews)</c:Multipage>

And I want to simply render the inner text of the pageview.

I've tried

protected override void AddParsedSubObject(object obj) { ... ControlList.Add((Control)obj); ... }

and

Render(HtmlTextWriter output) { ... foreach (Control c in ControlList) c.RenderControl(); ... }

It seems to render simple things but any more complex set ups it makes mistakes on. I don't think this is the way to do it at all. I'm having difficulty finding out how I am supposed to be able to just render this. And whether I should treat it as text or child controls

A: 

You shouldn't need to explicity call Render. If the control is part of your page's control tree, it will get rendered.

matt-dot-net
A: 

It generally depends on whether or not you are display effectively read-only information or control information that would require view-state information. You can output raw HTML if it's read-only just fine but if it contains controls and requires view-state interaction then you'll want to create actual control objects and insert them into the containing object in the code behind.

It really depends on your specific situation, but it sounds like you could just output raw html into a generic DIV control or something, without knowing the specifics though it's a little tough to point you one way or the other.

Capital G