如何从服务器设置css(背景)属性?目前不起作用:(
CS
public string MyBackgroundColor { get; set; }
Run Code Online (Sandbox Code Playgroud)
ASPX
<style type="text/css">
html
{
background-color: '<%=MyBackgroundColor %>';
}
</style>
Run Code Online (Sandbox Code Playgroud)
你可以试试
的.aspx
<body id="body" runat="server">
...the body
Run Code Online (Sandbox Code Playgroud)
.aspx.cs
body.Style["Background-Color"] = blue;//just example you can try using your method too
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
13887 次 |
| 最近记录: |