使用C#和javascript选择在ASP.NET中保存文件 [英] Select ans save files in ASP.NET using C# and javascript

查看:87
本文介绍了使用C#和javascript选择在ASP.NET中保存文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在申请申请人上传档案的项目。我想将这些文件保存在项目的文件夹中。我想在asp.net html页面中使用javascript来选择和删除文件。用户选择所有文件后,我会将文件转换为字节,并使用c#[webmethods]将字节保存到项目的文件夹中。

请帮忙。



我尝试了什么:



我发现这个资源非常有用。

使用C#和VB.Net在ASP.Net中使用LinkBut​​ton Click事件从GridView下载文件 [ ^ ]

我试了但是它对我不起作用,因为我在代码中使用OnClick事件时出现错误。我想将此代码转换为javascript并使用c#pagemethods将文件保存在文件夹中。换句话说,我想使用html,javascript和c#来做同样的事情。即使我可以使用javascript将文件转换为字节,我将不胜感激。

Hi,

I am working on a project in which applicant will upload file. I want to save those files in a folder in my project. I want to use javascript for the selection and deletion of files in the asp.net html page. After the user selects all their file, i will convert the files into bytes and use c# [webmethods] to save the bytes into a folder in my project.
Please help.

What I have tried:

I found this resource very helpful.
Download Files from GridView using LinkButton Click Event in ASP.Net using C# and VB.Net[^]
I tried it but it does not work for me because i get an error when i use OnClick event in my code. I want to convert this code into javascript and use c# pagemethods to save the file in folder. In other words, I want to use html, javascript and c# to do the same thing. I would be grateful even if i can use javascript to convert the files to bytes.

推荐答案

ASP.NET - 文件上传 [ ^ ]



上传文件,保存在文件夹中并显示在带有下载和删除选项的ASP.Net GridView中 [ ^ ]


这篇关于使用C#和javascript选择在ASP.NET中保存文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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