开发者

Maintain file value during Grid validation

I have a Grid which contains a field with a file upload control in it. The 开发者_如何学JAVAproblem is if you go to update the grid and a validation fails the file is lost.

Can someone please tell me how and where I could store the file during postbacks?

Currently it is in a static field but I think this may not be a good idea?


I don't think you can keep the filename in the box during a postback without actually uploading the file... I don't think you can preset the value of a file-upload box, this would be a major security issue. If this was possible you could programatically set the value of the box to "/etc/passwd" and hide the box, and use javascript to submit the form...

I think you need to consider client-side validation. If you have something you need to validate server-side, you could do it in an ajax-call.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜