ASP中多表单控件的简单文件上传

发布于 2024-12-09 17:27:45 字数 160 浏览 0 评论 0原文

实际上我想开发一种 ASP 表单,其中有一个文件上传控件,另一个是一些表单元素,如文本、文本区域、复选框、单选按钮。我还需要使用 Javascript(客户端)和 ASP(服务器端)对这些控件进行验证。

我浏览了各种网站,但只上传了简单的文件,其中没有任何表单元素。谁能帮我解决这个问题吗?

Actually i want to develop one ASP form in which there will be one File Upload Control and another will be few form elements like Text, TextArea, Checkbox, RadioButton. I need to put validation on these controls using Javascript (Client Side) and ASP (Server Side) too.

I had gone through various sites but got only simple file upload without any form element in it. Can anyone help me with this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

亽野灬性zι浪 2024-12-16 17:27:45

您可以编写一个 JavaScript 函数来在客户端进行验证并将表单对象传递给它。类似于表单标签中的 onsubmit="return validate(this)" 并在那里进行所有验证。

在服务器端,您拥有所有提交的数据,您可以正常验证这些数据。如果您使用 ASp,最好使用任何第三方文件上传器对象来上传文件,因为它们更容易且更安全地处理。

you can write a javascript function to validate at client side and pass the form object to it. something like onsubmit="return validate(this)" in the form tag and do all your validations there.

On Server side you have all your submitted data which you can validate as normal. If you are using ASp, it is better to use any third party file uploader object for uploading files as they are easier and safer to handle.

新人笑 2024-12-16 17:27:45

我刚刚完成 AJAX 文件上传器的开发。 http://www.plupload.com/example_all_runtimes.php 是一个不错的选择。如果你看一下自定义示例,你不仅可以进行ajax上传,还可以将参数附加到AJAX帖子中,这就是我所做的。我的页面上有许多表单字段,当点击发送按钮时,我只是让 Javascript 抓取这些字段的值,将它们附加到上传者的发布请求中,然后我像任何其他一样在服务器端处理它们其他帖子。为了找到解决方案进行了大量研究,但效果惊人!

I just finished working on an AJAX file uploader. http://www.plupload.com/example_all_runtimes.php was a good option. If you look at the custom example, you can not only do ajax uploads, but you can attach parameters to the AJAX post, which is what I did. I had a number of form fields on the page, and when the send button was hit, I just had Javascript grab the values of those fields, append them to the post request of the uploader, then I handled them on the server side like any other post. It was a lot of research to find the solution, but it works amazing!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文