从ASP.NET更改CSS样式code [英] Changing CSS style from ASP.NET code
本文介绍了从ASP.NET更改CSS样式code的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能重复:结果
更改CSS动态
块引用>我需要从ASP.NET code(VB)改变一个div容器(CSS属性height)的高度。
我怎么能这样做?
解决方案C#,因为我不想错字VB的语法。
标记:
< DIV =服务器ID =divControl> ...< / DIV>
块引用>页面级别:
保护System.Web.UI.HtmlControls.HtmlGenericControl divControl;
块引用>的OnLoad /其它功能:
divControl.Style.Add(高度,数/ anotherNumer);
块引用>Possible Duplicate:
Change CSS DynamicallyI need to change the height of a div container(CSS Property Height) from ASP.NET code (VB).
How can I do that?
解决方案C#, because I don't want to typo the VB syntax.
Markup:
<div runat="server" id="divControl">...</div>
Class of the Page:
protected System.Web.UI.HtmlControls.HtmlGenericControl divControl;
OnLoad/Other function:
divControl.Style.Add("height", number / anotherNumer);
这篇关于从ASP.NET更改CSS样式code的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文