model for dymanically built web pages...

  • Thread starter Thread starter Dan Bass
  • Start date Start date
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.
 
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
 
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!
 
Back
Top