解决方案 »
- asp.net如何导出data文件
- 问一个IIS发布后出现的问题
- 为何我的程序向Sql server写的中文都是乱码?
- window.showModalDialog 相关问题
- dataset的作用是不可以理解为java中的hibernate?
- [Web控件中]有一个TextBox和一个LinkButton 点击该LinkButton获取TextBox.Text的值,如何做?
- 为什么上传到购买的虚拟主机上,验证不起作用了?
- 怎么统计用户登出的时间
- 使用Parameter的参数化查询和直接写SQL有什么区别?
- 大家帮忙,我在写测试代码,不知道怎么写,没接触过!SoapClientMessage and SoapServerMessage
- Datalist里嵌套GridView 怎么用按钮发送对应的GridView内容,求解决方法
- 未将对象引用设置到对象的实例。
<%#Int.Parse(Eval("id字段").ToString())+Int.Parse(Eval("a字段").ToString())+Int.Parse(Eval("b字段").ToString())%>
也可以用这种//GridView1_RowDataBound事件中
e.Row.Cells[2].Text = Convert.ToInt32(e.Row.Cells[0].Text) + Convert.ToInt32(e.Row.Cells[1].Text);
<%#Int.Parse(Eval("id字段").ToString())+Int.Parse(Eval("a字段").ToString())+Int.Parse(Eval("b字段").ToString())%>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:BoundField HeaderText="ID" DataField="ID" />
<asp:BoundField HeaderText="A" DataField="A" />
<asp:BoundField HeaderText="B" DataField="B" />
<asp:TemplateField>
<HeaderTemplate>
Sum</HeaderTemplate>
<ItemTemplate>
<%#int.Parse(Eval("ID").ToString()) + int.Parse(Eval("a").ToString()) + int.Parse(Eval("b").ToString())%>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>