1
net c#项目。我需要将颜色值从c#代码传递给asp.net样式类。我的类是将c#的颜色值传递给aspx风格的类
<style>div.timeline-event {
color: #1A1A1A;
border-color: green;
background-color:#EFD5F6;
display: inline-block;
}</style>
我曾尝试下面的代码来传递值串
MyBackgroundColor = "#EFD5F6";
在我上面declred页负载。
div.timeline-event {
color: #1A1A1A;
border-color: green;
background-color:'<%=MyBackgroundColor %>';
display: inline-block;
}
但我无法通过它的课。怎么能做到这一点?
是否[此SO问题](http://stackoverflow.com/questions/4147370/using-c-sharp-to-dynamically-generate-css-files)给你任何提示? –