求用户控件在网页中的绝对定位方法
我做了一个用户控件,原码很简单,如下:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="MY_APP_UserControl_WebUserControl" %>
<table cellpadding="0" cellspacing="0">
<tr><td align="left">
<asp:Label ID="L_Title" style="font-size: 10pt; font-family: 宋体;" runat="server" Text="货币控件:"></asp:Label>
</td></tr>
<tr><td align="left">
<asp:TextBox ID="TextBox1" runat="server" ></asp:TextBox>
</td></tr>
</table>
但是, 我把这个放到网叶中不知道怎么来定位,由于用途关系,不能用表格来定位,必须使用绝对位置.
我使用的语句是这样的:
UC_Percent4_1.Attributes.Add("style", "z-index: 502; left: 889px; position: absolute;top: 552px");
但是如果我使用2005自带的服务器控件,是可以实现的,如:
Login1.Attributes.Add("style", "z-index: 502; left: 99px; position: absolute;top: 482px");
我想是不是我的用户控件必须设置一个什么样式或者布局什么的,请各位帮帮忙!