<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<input id="Button2" type="button" onclick="onupdatebuttonclick()" value="提交" />
<asp:Button ID="Button1" runat="server" Text="后台取值" onclick="Button1_Click" />
<aspabel ID="Label1" runat="server" Text="Label"></aspabel>
<FarPoint:FpSpread ID="FpSpread1" runat="server" BorderColor="#A0A0A0"
BorderStyle="Solid" BorderWidth="1px" Height="200" Width="400">
<commandbar backcolor="#F6F6F6" buttonfacecolor="Control"
buttonhighlightcolor="ControlLightLight" buttonshadowcolor="ControlDark">
</commandbar>
<sheets>
<FarPoint:SheetView SheetName="Sheet1">
</FarPoint:SheetView>
</sheets>
</FarPoint:FpSpread>
</div>
</form>
</body>
<script type="text/javascript">
function onupdatebuttonclick() {
fpspread1.update();
}
</script>
</html>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
FpSpread1.Sheets[0].Cells[0, 0].Text = "10";
}
}
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = FpSpread1.Sheets[0].Cells[0, 0].Text;
}
} |