You might be able to use the Panel control for that, since it creates a div.
Here's a little sample that uses a postback to change the position, size and
colour of the panel.
Ken
Microsoft MVP [ASP.NET]
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Protected Sub Page_Load _
(ByVal sender As Object, _
ByVal e As System.EventArgs)
If Not IsPostBack Then
pnl1.Attributes.Add _
("style", "z-index: 101; left: 100px; width: 100px;" & _
" position: absolute; top: 100px; height: " & _
"100px;background-color: green;")
End If
End Sub
Protected Sub Button1_Click _
(ByVal sender As Object, _
ByVal e As System.EventArgs)
pnl1.Attributes.Add("style", "z-index: 101; left: 428px;" & _
" width: 100px; position: absolute; top: 112px;" & _
"height: 200px; background-color: yellow;")
End Sub
</script>
<html xmlns="
http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp
anel id="pnl1" runat="server" Width="125px" Height="50px"
backcolor="AliceBlue"> </asp
anel>
<br />
<asp:button id="Button1" runat="server" onclick="Button1_Click"
text="Button" /></div>
</form>
</body>
</html>
Vear said:
Hi,
I have several <Div>'s that I have assigned an ID for. When the page loads
It set the Absolute Position through a Style sheet. Can I then reference
the
<Div> through VB to move it to another Absolute. if so can you show me the
VB
syntax.
Thanks