运行与每个asp.net控制脚本分开的多个Image ProgressBars? [英] Run multi Image ProgressBars seperate from each of asp.net control script?!

查看:88
本文介绍了运行与每个asp.net控制脚本分开的多个Image ProgressBars?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我正在Image ProgressBar下面进行测试.我正在尝试为每个按钮作业(在第二个代码下方)添加图像进度栏.目前,如果我运行Button1或button2,则两个Image ProgressBars都在运行.但是我想,如果运行Button1,则只能运行一个进度条.

也尝试使用AsyncPostBackTrigger,并将UpdatePanel更改为UpdateMode ="Conditional"> ?!

需要帮助,提示等

Hello,
I''m testing below Image ProgressBar. I''m trying to add, for each button job (below second codes), image progress bar. At the moment if I run Button1, or button2 both Image ProgressBars are running. But I want to, if run Button1 then only one progressbar could run.

Trying also with AsyncPostBackTrigger, and changing UpdatePanel to UpdateMode="Conditional"> ?!

Need help, tips, etc

<form id="form1"  runat="server">    
<asp:ScriptManager ID="ScriptManager1" runat="server">    
    
<div>    
  
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">    
  
<triggers>    
<asp:AsyncPostBackTrigger ControlID="button1" />    
</triggers>    
<contenttemplate>    
<asp:Button ID="Button1" runat="server" Text="Button" />    
<asp:UpdateProgress ID="UpdateProgress1" runat="server">    
<progresstemplate>    
<img alt="" class="style1" src="ajax-loader.gif" />    
</progresstemplate>    
    
</contenttemplate>    
    
</div>    
  
<div>    
  
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">    
  
<triggers>    
<asp:AsyncPostBackTrigger ControlID="button2" />    
</triggers>    
<contenttemplate>    
<asp:Button ID="Button2" runat="server" Text="Button" />    
<asp:UpdateProgress ID="UpdateProgress2" runat="server">    
<progresstemplate>    
  
<img alt="" class="style1" src="ajax-loader1.gif" />    
</progresstemplate>    
    
</contenttemplate>    
    
</div>    
</form>  





Protected Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click    
System.IO.File.Copy("J:\PROGRAMI\SQL, VISUAL\SQLEXPRADV_server_x86_ENU.exe", "C:\Documents and Settings\DEJANC\Desktop\test.exe")    
End Sub    
  
  
Protected Sub Button2_Click(sender As Object, e As System.EventArgs) Handles Button2.Click    
System.IO.File.Copy("J:\PROGRAMI\SQL, VISUAL\SQLEXPRADV_server_x86_ENU.exe", "C:\Documents and Settings\DEJANC\Desktop\test.exe")    
End Sub  



预先感谢您对任何人的帮助!



Thank you in advance for help to anyone!

推荐答案

您好,

在这里,我尝试了一些符合您要求的代码.

在运行的进程中显示多个图像.但是我使用了Jquery来实现

如果尝试此操作,则必须喜欢Jquery的方式.

Hi,

Here I tried some code for your requirement.

to show multiple images on running process.But I used Jquery for that

If you try this you must like way of Jquery.

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
    <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script language ="javascript" >
        function f1() {
            frstcpy("frstproc","Yes");
            jQuery.post("default11.aspx?action=cpy", { name: "fileone" }, function (data) {
                frstcpy("frstproc", "No");
            });
        }
        function f2() {
            frstcpy("scndproc", "Yes");
            jQuery.post("default11.aspx?action=cpy", { name: "filetwo" }, function (data) {
                frstcpy("scndproc", "No");
            });
        }
        function frstcpy(tid, opt) {
            if (opt == "Yes") {


(" + tid).html (" ); } 其他 {
("#" + tid).html("copying....."); } else {


(" + tid).html(" ); } } < / 脚本 > < /head > < 正文 < 表单 =" form1" runat >服务器" > < div > < div =" frstresdiv" < 输入 类型 =" 按钮" =" id =" onclick f1()" / > < br > < div =" frstproc" < > < /div > < br > < div > < 输入 =" =" =" btncopytwo" onclick =" f2()" / > < br > < div =" scndproc" < > < /div > < /div > < /form > < /body > < /html >
("#" + tid).html(""); } } </script> </head> <body > <form id="form1" runat="server"> <div> <div id="frstresdiv"> <input type ="button" value ="copyfileone" id="btncopyone" onclick="f1()" /> <br /> <div id="frstproc"></div> </div><br /> <div> <input type ="button" value ="copyfiletwo" id="btncopytwo" onclick ="f2()" /> <br /> <div id="scndproc"></div> </div> </div> </form> </body> </html>



文件后面的代码包含以下代码



And code behind file contains following code

protected void Page_Load(object sender, EventArgs e)
{
    if (Request.QueryString["action"] != null)
    {
        Response.Clear();
        Thread.Sleep(3000);
        Response.End();
    }
}



在这里,我使用div标签html代替它,您也可以显示图像.

踏入Jquery的宝贵经验,以开发有效的输出


最好的



Here I used div tag html instead of this you can display image also.

step into Jquery its really good experience to develop effective outputs


All the Best


这篇关于运行与每个asp.net控制脚本分开的多个Image ProgressBars?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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