[英]How to convert ASP.NET controls in HTML runtime
I am trying to add an asp.net image control () in a panel at runtime. 我试图在运行时在面板中添加一个asp.net图像控件()。
I have the asp.net code in the label text as <asp:Image runat="server" ImageUrl="test.png"/>
(its just a example) 我在标签文本中将asp.net代码作为
<asp:Image runat="server" ImageUrl="test.png"/>
(仅作为示例)
When I added this label in the panel control with: pnlPlaceHolderPanel.Controls.Add(htmlLabel);
当我使用以下
pnlPlaceHolderPanel.Controls.Add(htmlLabel);
在面板控件中添加此标签时: pnlPlaceHolderPanel.Controls.Add(htmlLabel);
The image does not display. 图像不显示。 When I checked the HTML using inspect element in the browser , the element displayed in
<asp:Image>
, but it should be <img>
tag of HTML. 当我使用浏览器中的inspect元素检查HTML时,该元素显示在
<asp:Image>
,但它应该是HTML的<img>
标记。
So does anybody know how should I convert that asp.net design code into HTML code? 那么,有人知道我应该如何将asp.net设计代码转换为HTML代码?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.