如何在ASP.NET后台中添加前台这段代码

来源:百度知道 编辑:UC知道 时间:2024/05/14 06:15:23
<p style="background-color:Aqua">男士头像</p>
用Respone.Write()的我会,可是那个只能在整个页面,我想只在PANEl那个控件中添加的呀

我说一下两种方法
1 在前台加一个asp:Lable控件
在后台使用 lable.Text="<p style=\"background-color:Aqua\">男士头像</p>";
2
在后台定义一个public变量
public string str=<p style=\"background-color:Aqua\">男士头像</p>
前面你要使用的地方用<%=str%>
例如:<div><%=str%></div>

看不懂,不明白你在说什么。
用Respone.write("你的代码");试试

string str="<p style='background-color:Aqua'>男士头像</p>";

string str="<p style='background-color:Aqua'>男士头像</p>";
Response.write(str);

看四楼的那个方法!呵呵~~