如何使用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.