Skip to content Skip to sidebar Skip to footer

How To Set The Size Of Div In Asp.net Using Vb Code

setting the size of div in HTML: height: 1000px; Is it possible to set the size of a div in asp.net using vb code? what i mean is how can i put a mark up language in a vb code

Solution 1:

First off if you want to access the Div from your code behind you've gotta make sure it has the runat="server" and ID="SomeID" attributes set, then you can access it from code behind like any other Asp.Net control.

Markup:

<div runat="server"id="myDiv"></div>

VB.Net

ProtectedSub Page_Load(ByVal sender AsObject, ByVal e As System.EventArgs) HandlesMe.Load
        myDiv.Attributes.Add("style", "height:1000px")
EndSub

Post a Comment for "How To Set The Size Of Div In Asp.net Using Vb Code"