I do not know why, but dragging a Label to the form (.aspx) from the Toolbox seems to exclude the "Style" option in the code. In 2005 it was easy to automate and make it absolute via Layout-Position-Auto_Posit
ion_Option
s, but I do not know how to achieve the same thing in the 2008 VS WebFoms. Here I have to do it manually. That is crippling for a guy like me who prefers the GUI designer for building the form.
Here is some code to make this clearer.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.
cs" Inherits="WEP2.WebForm1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml"
>
<head runat="server">
<title>MS KRAPP</title>
<style type="text/css">
#form1
{
height: 288px;
width: 405px;
top: 7px;
left: 5px;
position: absolute;
}
</style>
</head>
<body>
<form id="form1" runat="server" name="This is the name LALA"
title="My first WEB Page">
<asp:Button ID="Button1" runat="server" onclick="Button1_Click"
style="z-index: 1; left: 53px; top: 214px; position: absolute; height: 34px; width: 176px"
Text="Button" />
<asp:Button ID="Button2" runat="server" onclick="Button2_Click"
style="z-index: 1; left: 253px; top: 63px; position: absolute" Text="Button" />
<asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
<br />
<br />
<br />
<p style="top: 111px; left: 113px; height: 34px; width: 179px; position: absolute">
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</p>
<br />
<br />
<br />
<br />
<br />
<br />
// THIS IS HOW IT COMES UP
<asp:Label ID="Label3" runat="server"
Text="Label"></asp:Label>
<asp:Label ID="Label4" runat="server" Text="Label"></asp:Label>
/* BUT IT SHOULD COME UP AS FOLLOWS
<asp:Label ID="Label3" runat="server"
style="z-index: 1; left: 147px; top: 94px; position: absolute" Text="Label"></asp:Label>
<asp:Label ID="Label4" runat="server" Text="Label"></asp:Label>
*/
</form>
</body>
</html>
Notice the ' style="z-index: 1; left: 147px; top: 94px; position: absolute" ' is excluded from the code and I know that it can be automated, since it was automatic in 2005. Somebody please help...
DK