当前位置: 代码迷 >> ASP.NET >> PlaceHolder中可以添加html代码么?解决办法
  详细解决方案

PlaceHolder中可以添加html代码么?解决办法

热度:2740   发布时间:2013-02-25 00:00:00.0
PlaceHolder中可以添加html代码么?
现在需要添加ASP控件和<hr/>,想知道怎么能够添加<hr/>

------解决方案--------------------------------------------------------
你直接在代码视图中添加不就ok?
------解决方案--------------------------------------------------------
Literal hr=new Literal();
hr.Text="<hr/>";
PlaceHolder1.Controls.Add(hr);
------解决方案--------------------------------------------------------
HTML code
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">    <asp:Literal ID="Literal1" runat="server"></asp:Literal></asp:Content>
------解决方案--------------------------------------------------------
探讨

Literal hr=new Literal();
hr.Text="<hr/>";
PlaceHolder1.Controls.Add(hr);
  相关解决方案