c#post请求url未设置返回值情况下的返回值是啥

这个是我在开发一个视频播放时遇到的问题

#####这是前端的代码

 $("#button2").click(function () {
            //创建XMLHttpRequest对象
            var xhr = new XMLHttpRequest();
            //配置请求方式、请求地址以及是否异步
            xhr.open('POST', '/Aerial/Video?pId=' + $("#platformId2").val(), true);
            //设置请求结果类型为blob
            xhr.responseType = 'blob';
            //请求成功回调函数
            xhr.onload = function (e) {
                if (this.status == 200) {//请求成功

                    var blob = this.response;
                    var video2 = document.getElementById('video_player2');
                    var obj_url = window.URL.createObjectURL(blob);
                    video2.src = obj_url;
                }
            };
            xhr.send();
            function revokeUrl(url) {
                window.URL.revokeObjectURL(url);
            }
        });

######这是控制器里的代码

public void Video(string pId)
        {
            //var pId = "HYNB_MP";
            var url = GetAerialUrl(pId);
            var filePath = Urlconvertorlocal(url);
            //这里需要获取全路径 如:D:\project\images\video\products\video.mp4
            System.IO.FileInfo fileInfo = new System.IO.FileInfo(filePath);
            if (fileInfo.Exists == true)
            {
                FileStream fs = new FileStream(filePath, FileMode.Open);
                byte[] bytes = new byte[(int)fs.Length];
                fs.Read(bytes, 0, bytes.Length);
                fs.Close();

                //Response.AddHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(fileInfo.Name));
                Response.AddHeader("Content-Length", "" + fileInfo.Length.ToString());
                Response.AddHeader("Content-Transfer-Encoding", "binary");
                Response.ContentType = "application/octet-stream";
                Response.ContentEncoding = System.Text.Encoding.UTF8;
                Response.BinaryWrite(bytes);
                Response.Flush();
                Response.End();
            }
        }

运行成功后会成功播放视频但我想不通我的video方法明明时void无返回值的,但为何我设置了返回值后还是会正常返回

因为题主调用了Response.BinaryWrite输出内容。和方法什么返回值没关系。如果方法设置了返回值,那么要在最后返回和方法定义的类型一样的数据,要不编译时会报错。
mvc的直接定义返回值为ActionResult,return File(filePath ,"application/octet-stream");就行了,不用搞那么麻烦。然后mvc会自动调用Response对象输出需要的信息,只是mvc做了包装,不需要调用Response相关方法输出。
如果题主学过webform,就很好理解Response.Write作用了。webform很多处理方法都是void类型的,特别ashx处理文件,都是用Response获取和输出内容到客户端。
有帮助或启发麻烦点下【采纳该答案】,谢谢~~

你这个是下载文件吧,正常应该是弹出下载文件的对话框。