回复 1楼liudongyue1987的帖子
liudongyue1987 你好
Spread没有提供在前台获取SheetName的方法,你可以在后台代码中设置Spread的Attribute属性,然后在前台访问:
后台代码:
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!IsPostBack)
- {
- FpSpread1.Attributes.Add("SheetName", FpSpread1.Sheets[0].SheetName +","+ FpSpread1.Sheets[1].SheetName);
- }
- }
复制代码
前台代码:
- <script language="javascript" type="text/javascript">
- function Button1_onclick() {
- var spread = document.getElementById("FpSpread1");
- alert(spread.getAttribute("SheetName"));
- }
- </script>
复制代码 |