单击“保存"按钮时,如何验证GridView是否选择了“任何人"行? [英] How to Validate The GridView whether Anyone row is selected or not when Click the Save button?

查看:67
本文介绍了单击“保存"按钮时,如何验证GridView是否选择了“任何人"行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用带有AutoGenerateSelect按钮的网格视图..

单击保存"按钮以将页面提交到服务器时,是否要在任一网格视图行上进行Javascript验证.

感谢和问候...

[edit]已更改标签以反映问题内容[/edit]

I using The Grid View with AutoGenerateSelect Button..

I want to do the Javascript validation on the any one Grid view row is Selected or not when Click the Save button to Submit the page to Server..

Thanks And Regards...

[edit]Tags changed to reflect question content[/edit]

推荐答案

亲爱的;

我认为使用保存按钮一次对所有行进行验证是浪费时间.如果我是我,我将转到脏行,这意味着更新的任何行都将添加到int数组或列表中,然后在保存时单击,仅验证那些脏行.

原因:
1-更少的时间渲染
2-您知道受影响的行,即:行1-5-90等,并且您仅通过服务器端(C#)或客户端javascript来验证那些行
Dear;

i think it is a waste of time to validate all the rows once with the save button. if i were you i would go to dirty rows, that means any row that''s updated will be added to an int array or list and then on save click you validate only those dirty rows.

Reason:
1- less time rendering
2- you know the affected rows ie: row 1-5-90 etc and you validate only those rows whether by server side(C#) or client side javascript


这篇关于单击“保存"按钮时,如何验证GridView是否选择了“任何人"行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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