开发者

How to Upgrade Existing ASP.NET 1.1 Custom CMS to ASP.NET 4.0?

开发者 https://www.devze.com 2022-12-21 10:21 出处:网络
Here\'s what I have: Custom-made C# CMS where the content is stored in a database in XML, and XSLT is applied to format the page content.

Here's what I have:

  • Custom-made C# CMS where the content is stored in a database in XML, and XSLT is applied to format the page content.

Here's my task:

  • Design new front-end site and upgrade to ASP.NET 4.0 (via ASP.NET 2.0 first) in the process. Accessibility and standards compliance are factors.

Here's my problem:

  • Comprehensive set of existing page and control classes with much dependency on XSLT for the rendering - will want to re-code much of this and also keep the existing DB schema.

**** Here's my question:**

Can anyone suggest a simple way to create my own set of "page layout" classes to use CSS instead of XSLT for all layout? Right now, the content is coming back as XML in a DataSet and applied to literal controls - it's a mess and I want to find a way to work against the existing XML content in the DB. Any suggestions?

UPDATE 1

Starting to think that Template Controls may be even more bother than XSLT for this...

UPDATE 2

Here is the structure of the existing XML. It's a huge site so performance will come into it when we start looking at custom controls. My goal is to have maximum control via CSS and clean markup.

<page>
    <section>
        <heading></heading>
        <content></content>
    </Section>

    <section>
        <heading></heading>
        <content>开发者_开发问答;</content>
    </Section>
    ...
</page>


This is the nearest I have come to the type of answer I'm looking for:

http://n2cms.com/Documentation/Templates.aspx


As always, I'll just try to answer the best way I understand so far. What about creating some custom ASP.NET server controls to translate the XML into HTML? You might have a control for tables, one for divs, one for paragraphs, etc. You might even be able to inherit from HTMLGenericControl for each of these and override the rendering to translate into what you want.

Again, I could totally misunderstand your question, but I'm imagining a class that would act as a controller where the XML would be sent. This might call off to a factory that would generate the correct type of custom control to handle the XML and translate it to the desired HTML and CSS?

Could you post an example of the XML content?

0

精彩评论

暂无评论...
验证码 换一张
取 消