如何使用JavaScript从gridview中的templatefield按钮验证文件上传控件? [英] How to validate file upload control from templatefield button in gridview using javascript?

查看:84
本文介绍了如何使用JavaScript从gridview中的templatefield按钮验证文件上传控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尊敬的先生,

请帮我...

如何使用JavaScript从gridview中的templatefield按钮验证文件上传控件? (这两个控件都在GridView控件内部).

如何验证这一点?

注意:仅访问图像文件格式,然后它将返回true.否则(其他格式)返回false.

作者Mohan

Dear sir,

please help me...

How to validate file upload control from templatefield button in gridview using javascript? (these two controls are having inside GridView Controls).

How can validate this???

Note: Access only Image file formats then it will Return true. otherwise(Other formats) return false.

By Mohan

推荐答案

出于安全目的,我不认为您可以与javascript中的上传控件进行交互.我认为您所能做的就是接收服务器上的文件.但是,我可能错了,总的来说,您为控件分配了一个有意义的ID,因此您可以使用javascript查找它们并与它们进行交互.
I don''t believe you can interact with the upload control in javascript, for security purposes. I think all you can do, is recieve the file on the server. But, I could be wrong, and in general, you assign your controls a meaningful id so you can use javascript to find them and interact with them.


这篇关于如何使用JavaScript从gridview中的templatefield按钮验证文件上传控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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