你是想在哪里读出???客户端还是服务器端?kind regard!!!!
解决方案 »
- 网站在服务器上面运行样式什么都没有问题,为什么在本地显示,样式就有问题啊
- 获取值的问题
- 大家打开下面的连接,他是如何实现的通过一个dll动态生成XML?
- datagrid连接到新页面的问题
- 为何鼠标点击textbox,textbox却无法得到焦点?
- Windows Update那种进度条如何实现?
- iframe 滚动条问题
- 请教一个手机缴费的问题,参与有分!!!
- 我升级了CrystalReport9.2,现在CrystalReportViewer不能往设计视图上拖放了,为什么?
- 如何在一主页面(网页)中单击一按钮打开一新的子页面(网页)!
- DateGrid里的列太多,能不能象DataList一样,只显示一部分,点击再列出详细内容
- 关于FindControl 方法使用的问题
可以的。
可以的。
如Left属性,将控件拖到窗体后,如果不在运行期设置
将读出来空值.我测试的代码很简单,请各位指点:[设计代码]
<%@ Page language="c#" Codebehind="position.aspx.cs" AutoEventWireup="false" Inherits="HRdotnet.position" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>position</title>
<meta content="Microsoft Visual Studio 7.0" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="position" method="post" runat="server">
<asp:TextBox id="txt" style="Z-INDEX: 101; LEFT: 141px; POSITION: absolute; TOP: 63px" runat="server"></asp:TextBox>
<asp:Calendar id="cal" style="Z-INDEX: 102; LEFT: 140px; POSITION: absolute; TOP: 90px" runat="server" BorderWidth="1px" NextPrevFormat="FullMonth" BackColor="White" Width="224px" ForeColor="Black" Height="147px" Font-Size="9pt" Font-Names="Verdana" BorderColor="White">
<TodayDayStyle BackColor="#CCCCCC"></TodayDayStyle>
<NextPrevStyle Font-Size="8pt" Font-Bold="True" ForeColor="#333333" VerticalAlign="Bottom"></NextPrevStyle>
<DayHeaderStyle Font-Size="8pt" Font-Bold="True"></DayHeaderStyle>
<SelectedDayStyle ForeColor="White" BackColor="#333399"></SelectedDayStyle>
<TitleStyle Font-Size="12pt" Font-Bold="True" BorderWidth="4px" ForeColor="#333399" BorderColor="Black" BackColor="White"></TitleStyle>
<OtherMonthDayStyle ForeColor="#999999"></OtherMonthDayStyle>
</asp:Calendar>
<asp:Button id="Button1" style="Z-INDEX: 103; LEFT: 317px; POSITION: absolute; TOP: 63px" runat="server" Text="btn"></asp:Button>
<asp:Button id="Button2" style="Z-INDEX: 104; LEFT: 42px; POSITION: absolute; TOP: 108px" runat="server" Text="Button"></asp:Button></form>
</body>
</HTML>[codebehind代码]using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;namespace HRdotnet
{
/// <summary>
/// position 的摘要说明。
/// </summary>
public class position : System.Web.UI.Page
{
protected System.Web.UI.WebControls.TextBox txt;
protected System.Web.UI.WebControls.Calendar cal;
protected System.Web.UI.WebControls.Button Button2;
protected System.Web.UI.WebControls.Button Button1;
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
} #region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.Button2.Click += new System.EventHandler(this.Button2_Click);
this.Load += new System.EventHandler(this.Page_Load); }
#endregion public string GetTextRect(TextBox txt)
{
return "Left:"+txt.Style["Left"]+"px;Top:"+txt.Style["Top"]+"px;Width:"+txt.Style["Width"]+"px;Height:"+txt.Style["Height"]+"px";
} private void Button1_Click(object sender, System.EventArgs e)
{
Response.Write(this.GetTextRect(this.txt));
Response.Write(this.GetCalRect(this.cal));
} public string GetCalRect(Calendar cal)
{
return "Left:"+cal.Style["Left"]+"px;Top:"+cal.Style["Top"]+"px;Width:"+cal.Style["Width"]+"px;Height:"+cal.Style["Height"]+"px";
} private void Button2_Click(object sender, System.EventArgs e)
{
cal.Style.Add("Left","100");
}
}
}