繁体   English   中英

同时发送两个请求 第一个请求使用 C# WebClient 和第二个请求使用 Ajax

[英]Send two request simultaneously 1st request with C# WebClient and 2nd request with Ajax

嘿伙计们,我在 asp.net c# 中有一个页面,因为我正在做一些视频上传功能,所以我的视频上传代码在Page_Load()方法中,我正在使用WebClient上传视频文件。 我在页面上有一个animated gif图像

现在的问题是,当调用Page_Load()方法时,我的文件正在使用 WebClient 上传,而那时页面尚未呈现,所以我得到一个空白页面..我希望在上传过程中让gif图像动画化。 ..

注意:我只能使用WebClient's UploadFile()方法。

所以我在想有什么方法可以在新线程中运行我的上传功能并让页面被渲染..或者 ajax 在这种情况下是否有帮助?

protected void Page_Load(object sender, EventArgs e)
{
   UploadFile();//this method actually calls an API which uses WebClient to upload file
}

Another problem is to get a track of upload, that API gives a url which sends json response saying how much percent upload completed, so i also what to send request to this upload tracking url while my Uploading is goin' on simultaneously..

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM