[英]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.