在ASP.NET中更新网格视图 [英] UPDATING GRID VIEW IN ASP.NET

查看:65
本文介绍了在ASP.NET中更新网格视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试更新网格列表,但是我继续收到以下错误消息.

异常详细信息:System.InvalidCastException:无法将类型为"System.Web.UI.LiteralControl"的对象转换为类型为"System.Web.UI.WebControls.TextBox"."

请帮助

I am trying to update a grid list but I keep on receiving the following error message.

"Exception Details: System.InvalidCastException: Unable to cast object of type ''System.Web.UI.LiteralControl'' to type ''System.Web.UI.WebControls.TextBox''."

Please help

推荐答案

您不理解错误消息的哪一部分?很清楚.
您试图将类型为LiteralControl的对象转换为TextBox.
简单明了,您不能那样做.您可以从允许的LiteralControl文本值中设置TextBox文本值.
如果仍然不能解决问题,请发布导致您遇到困难的相关代码,以便我们进一步为您提供帮助.
干杯.
What part of the error message do you not understand? It is quite clear.
You are attempting to cast an object of type LiteralControl into a TextBox.
Plain and simple, you can''t do that. What you can do is set the TextBox text value from the LiteralControl text value which would be allowed.
If that doesn''t help, please post the relevant code which is causing you difficulty so that we can help you further.
Cheers.


这篇关于在ASP.NET中更新网格视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆