如何在运行时将ASP.Net代码转换为html

编程入门 行业动态 更新时间:2024-10-27 20:38:45
本文介绍了如何在运行时将ASP.Net代码转换为html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

任何人都知道如何在运行时将ASP.NET代码转换为HTML.就像在VS IDE中一样(设计源代码). 当我在文本框中输入如下所示的代码并单击一个按钮时 <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" /> 它应该将其转换为html并呈现按钮. 在此先感谢

Hi, Anyone know how to convert ASP.NET code to HTML at runtime. like it do in the VS IDE(Source to Design). when i entered some code like below to a text box and click a button <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" /> it should convert it to html and render the button. Thanks in advance

推荐答案

Visual Studio可能要求组件在流中输出自身. 通常,当IIS处理翻译时,我们很少需要手动执行该操作. 顺便说一下,Visual Studio设计器远非完美,因为复杂的布局通常与浏览器中看到的最终布局大不相同. Visual Studio probably ask the component to output itself in a stream. Generally as IIS handle the translation, we seldom need to do that manually. By the way, Visual Studio designer is far from perfect as complex layout often are quite different from the final layout someone would see in a browser.

更多推荐

如何在运行时将ASP.Net代码转换为html

本文发布于:2023-11-12 07:52:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1580929.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:转换为   时将   代码   如何在   Net

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!