HTML页面使用C#生成代码 [英] Html page Code generation using C#

查看:569
本文介绍了HTML页面使用C#生成代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要c#中的框架或类,该类或类将帮助我在获得固定用户的输入(例如表信息(无行,无列))并选择下拉菜单或其他Html标记中的项后,在Asp.net中生成HTML页面.信息.

最终输出应为textfile,该文件应为asp.net页面.任何指导或资源将不胜感激.我不想重新发明轮子或从头开始肆无忌..谢谢您的时间.

I want a framework or class in c# which will help me generate HTML pages in Asp.net after getting fixed user Input from the user like Table information ( No Rows , No Columns ) and select items in drop down or other Html tag information.

The final output should be textfile which should be asp.net pages . Any guidance or resource will be appreciated . I don''t want a reinvent wheel or start from first un wantedly . Thank you for your time .

推荐答案

您可能可以将其重新设计为符合您要求的内容:
ASP.NET查询控件 [
You''ll probably be able to rework this into something that fits your requirements:
ASP.NET Query control[^]

Regards
Espen Harlinn


由于HTML可以被视为XML(这就是您的HTML,因此您可以使其符合XHTML标准),所以任何低于XML的级别绝对是没有道理的. br/>
要使用C#生成HTML,可以使用例如System.Xml.XmlTextWriter类或System.Xml.XmlDataDocument类.由于HXML模式可用,因此您始终可以基于此模式生成XML,这将产生有效的HTML.

—SA
As HTML can be considered as XML (this is you HTML, so you can make it compliant to XHTML standard), anything of the level lower than XML make absolutely no sense.

To generate HTML with C# you can use, for example System.Xml.XmlTextWriter class or System.Xml.XmlDataDocument class. As HXML schema is available, you can always generate XML based in this schema which will yield valid HTML.

—SA




在某些情况下,ASP.NET
Repeater 可能适用,但是使用StringBuilder类手动将HTML标记可能也是个好方法.

希望这会有所帮助

劳伦斯
Hi,

An ASP.NET Repeater would be suitable in some cases however using the StringBuilder class to manually biuld up your HTML may also be a good method.

Hope this helps

Laurence


这篇关于HTML页面使用C#生成代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆