Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
asp.net、c#.net网格视图页脚问题_Asp.net_Footer - Fatal编程技术网

asp.net、c#.net网格视图页脚问题

asp.net、c#.net网格视图页脚问题,asp.net,footer,Asp.net,Footer,我在网页中有一个gridview 它包含列总值的页脚 我在Gridview中有一个列名Production value prod_val nvarchar(50) 对于数据绑定,我使用代码隐藏 protectedvoid grid\u search\u RowDataBound(对象发送方,GridViewRowEventArgs e) { if(e.Row.RowType==DataControlRowType.DataRow) { `tot_prodVal = tot_p

我在网页中有一个gridview

它包含列总值的页脚

我在Gridview中有一个列名Production value

prod_val nvarchar(50)

对于数据绑定,我使用代码隐藏

protectedvoid grid\u search\u RowDataBound(对象发送方,GridViewRowEventArgs e)
{
if(e.Row.RowType==DataControlRowType.DataRow)
{

        `tot_prodVal = tot_prodVal + Convert.ToDecimal(e.Row.Cells[2].Text);`
} }

但它在调试时显示了一个错误

System.FormatException:输入字符串的格式不正确


请给我解决方案。

既然您在问题中提到了页脚,我猜您希望在页脚中执行该操作。所以你的条件应该是

e.Row.RowType == DataControlRowType.Footer

我猜是因为您在自己的条件下使用了DataRow,即e.Row.Cells[2]。文本实际上并不指向您希望它指向的字段

请在我的(c#)asp.net网站中显示
prod_val
列的标记。我们允许用户登录时使用id和密码,我希望在另一个网页中查看活动(在线)用户。