Possible Duplicate:
Change CSS Dynamically
I 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);
VB Version:
Class:
Protected divControl As System.Web.UI.HtmlControls.HtmlGenericControl
OnLoad/Other function:
divControl.Style("height") = "200px"
I've never tried the Add method with the styles. What if the height already exists on the DIV?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With