Asp.net 图形上传过程?

Asp.net 图形上传过程?,asp.net,Asp.net,在我的应用程序中,我有一个上传视频的页面。在本页中,我正在进行视频转换,视频转换需要时间,因此我希望在视频转换过程中显示图像或消息,之后不应显示显示图像。你能帮我从谷歌搜索中获取一些代码吗?它在IE中运行良好,但在FireFox中却不行 public static void PrintProgressBar() { StringBuilder sb = new StringBuilder(); sb.Append("<div id='updiv'

在我的应用程序中,我有一个上传视频的页面。在本页中,我正在进行视频转换,视频转换需要时间,因此我希望在视频转换过程中显示图像或消息,之后不应显示显示图像。你能帮我从谷歌搜索中获取一些代码吗?它在IE中运行良好,但在FireFox中却不行

public static void PrintProgressBar()

    {

       StringBuilder sb = new StringBuilder();

       sb.Append("<div id='updiv' style='Font-weight:bold;font-size:11pt;Left:320px;COLOR:black;font-family:verdana;Position:absolute;Top:140px;Text-Align:center;'>");

      sb.Append("&nbsp;<script> var up_div=document.getElementById('updiv');up_div.innerText='';</script>");

       sb.Append("<script language=javascript>");

        sb.Append("var dts=0; var dtmax=10;");

       sb.Append("function ShowWait(){var output;output='Please wait while uploading!';dts++;if(dts>=dtmax)dts=1;");

      sb.Append("for(var x=0;x < dts; x++){output+='';}up_div.innerText=output;up_div.style.color='red';}");

       sb.Append("function StartShowWait(){up_div.style.visibility='visible';ShowWait();window.setInterval('ShowWait()',100);}");

       sb.Append("StartShowWait();</script>");

       HttpContext.Current.Response.Write(sb.ToString());

        HttpContext.Current.Response.Flush();

       btnSubmit.Enable = false;

}   



public static void ClearProgressBar()

    {



        StringBuilder sbc = new StringBuilder();

        sbc.Append("<script language='javascript'>");

        sbc.Append("alert('Upload process completed successfully!');");

        sbc.Append("up_div.style.visibility='hidden';");

        sbc.Append("history.go(-1)");

        sbc.Append("</script>");

        HttpContext.Current.Response.Write(sbc);

    }
publicstaticvoidprintprogressbar()
{
StringBuilder sb=新的StringBuilder();
某人加上(“”);
sb.Append(“var up_div=document.getElementById('updiv');up_div.innerText='';”;
某人加上(“”);
sb.追加(“var dts=0;var dtmax=10;”;
sb.Append(“函数ShowWait(){var output;output='Please wait while upload!';dts++;if(dts>=dtmax)dts=1;”;
sb.Append(“for(var x=0;x

这是我调用
Response时使用的代码。Write()
将在HTML中的错误位置输出脚本

相反,您应该使用内置方法将脚本添加到页面中,并在代码中创建正确的Html元素,并将它们添加到相关控件中

将脚本添加到网页的方法:

Page.RegisterClientScriptBlock(String scriptIdentifier, String script, 
       [optional Boolean addScriptTagsAroundScript]);

你能用AJAX更新面板试试同样的方法吗..看起来它应该在某种模板中。。。