[RESOLVED] Template "engine" in ASP.NET
Is there a template engine in ASP.NET? I have been searching the forums a bit, and "ASP.NET theme" does not look quite as what I want. It should simply just hold one or more (X)HTML templates and be able to do string replace and so on before sending the finished page to back to the client.
Much like Smarty for PHP or Cheetah for Python if anyone of you has ever touched some real server side languages :p
- ØØ -
Re: Template "engine" in ASP.NET
Is it really you? :eek2:
What you're looking for is a combination of Master Pages and web user controls. Master Pages to control the overall layout of the page, and a user control which can sit in any page which accepts values (public properties) which in turn are used to populate the various asp:literal and asp:label controls in the web user control.
You have to keep in mind that the way templates worked in PHP (string replacement) is due to the fact that PHP was script-based rather than object oriented, and so the way things are done in ASP.NET are different. Which means that the same feature is implemented differently when you're doing it in ASP.NET.
Another option, for example, would be to have as you said an XSLT file which you can then .Transform() and get a rendered output.
Re: Template "engine" in ASP.NET
You spelled "coming" wrong.
Re: Template "engine" in ASP.NET
Both Smarty and Cheetah is class based as well, so your analogy won't hold. But I'll give in to your "kingdomness", and obey the Master pages, and see how much damage they can do to me before they bow for my feet.
Thanks a lot, and about that spelling. I did that on purpose. I was not sure if you would recognize me again if I didn't add a spelling mistake or two in my question.
Cheers,
- ØØ -
Re: Template "engine" in ASP.NET
I'd say they're "class based" rather than class based. :afrog:
Now come to chit chat.