model for dymanically built web pages...

D

Dan Bass

In short, I'm looking for a way to take in an XML file, which tells me the
controls on a page, then generate this page for the client who requested it.
I'm using ASP.Net 2.0 beta 2, or 1.1 (c#), which ever is more appropriate...

Is there an existing model for doing this?

I was thinking, that a user would click on a link, something like
"MyPage.aspx?xml=TimeReport.xml", whcih would then use the query string to
get the xml file to build the page from. A StringBuilder object with the
relevant HTML declarations and inline C# scripting, would then be generated
from the XML that was parsed, and then using Response.Write to dump this
back up to the client.
The one problem with this is I'm not sure how to hook up events. A button
press would be used to refresh the page, and rebind a grid control, for
example.

Any thoughts on this would be appreciated.

Thanks.

Dan.
 
K

Karl Seguin

Your idea isn't ideal, and there are samples out there. I'd look at the
Community Starter Kit
http://asp.net/StarterKits/DownloadCommunity.aspx?tabindex=0&tabid=1

I think you'll be very pleased at how it'll help you.

For a quick tip, you don't want to have a huge html string that you just
response.write (yuck!). You want to dymamically load user controls.

A very simple example:
<page id="blah">
<control target="leftNav">login.ascx</control>
<control target="main">news.ascx</control>
</page>

Page pseudo-code:
Get controls for page "blah"
loop through controls
FindControl(target)
if target is not nothing then
LoadControl(control)
Target add control (control)
end if
next control


Karl
 
D

Dan Bass

Thanks for the reply and example, I'll follow up on that link.

For a quick tip, you don't want to have a huge html string that you just
response.write (yuck!).

I agree, it wasn't a very nice means of doing it!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top