本文介绍了如何在运行时将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
发布评论