Asp.net和C#中的ProgressBar [英] ProgressBar In Asp.net and C#
本文介绍了Asp.net和C#中的ProgressBar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你能不能请任何人帮助我如何在asp.net中实现进度条和c#
解决方案
在Google中搜索...
ProgressBar for ASP.NET [ ^ ]
http://www.dotnetcurry.com/ShowArticle.aspx?ID=384 [ ^ ]
http://www.dotnetfunda.com/codes/code1439-progress-bar-in-aspnet.aspx [ ^ ]
请按照以下步骤在申请后创建显示
步骤为:
1-开始 - >所有程序 - > Visual Studio 2005或Visual Studio 2008
2-现在转到文件菜单 - >新 - >网站
3-在Visual Studio安装模板下 - >选择ASP.NET WEB SITE - >从位置组合框中选择文件系统 - >通过浏览按钮设置路径 - >从语言组合框中选择语言(Visual C#,Visual Basic,J#)
选择Visual C#
4 - 单击OK按钮: -
首先,您必须学习XML和HTML才能使用ASP .NET_
我曾经将文本作为注释,这是在此代码中发表评论的方式...
这是源代码窗口,在此页面中您将获得此代码...
<%@ < span class =code-attribute> Page 语言 = C# AutoEventWireup = true CodeFile = Default.aspx.cs 继承 = _默认 %>
< !DOCTYPE html PUBLIC - // W3C // DTD XHTML 1.0 Transitional // EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-t ransitional.dtd >
< html xmlns = http://www.w3.org/1999/xhtml >
< head runat = server >
< title < span class =code-keyword>> 在此处输入您的网页标题< / title > < ! - 此处 你 指定 你的 page 标题 title 标记 - >
< / head >
< body >
< 表格 id = form1? runat = server >
< div >
< ! - 在 之间 div tags 你 可以 manage 您的 web controls 喜欢 按钮, 标签, picture
Box, < span class =code-attribute> ImageMap etc - >
< / div & gt;
< / form >
< / body >
< / html >
这里是一个名为Design的标签页在本页底部
5-点击这个选项卡,您将看到一个空白网页,您可以从工具箱中拖动任何控件(位于此窗口的左侧)
6-copy和.gif进度图像并将其粘贴到解决方案探索者。
7-现在拖动AJAX扩展下的一些控件
一个scriptmanager
一个UpdatePanel
一个UpdateProgress
现在设置这样的源代码窗口....
在表格标签下___ b
$ b < asp:ScriptManager ID = ScriptManager1 runat = server >
< / asp:ScriptManager >
< asp:UpdatePanel ID = UpdatePanel1 runa t = server UpdateMode = 条件 >
< ContentTemplate < span class =code-keyword>>
< center >
< div > < asp:按钮 ID = button1 runat = server 文字 = < span class =code-keyword>更新时间/日期
onclick = button1_Click / >
< br / >
< asp:Label ID = label1 runat = server > < / asp:Label >
< / div >
< / center >
< / ContentTemplate >
< / asp:UpdatePanel >
< asp:UpdateProgress ID = UpdateProgress1 runat = server AssociatedUpdatePanelID = UpdatePanel1 DisplayAfter < span class =code-keyword> = 2000 DynamicLayout = true >
< ProgressTemplate >
< center > < img src = progress.gif runat = 服务器 / > < / center >
< / ProgressTemplate >
< / asp:UpdateProgress >
8-现在在设计窗口中双击按钮并在代码窗口中输入此代码...
protected void button1_Click(object sender,EventArgs e)
{
System.Threading.Thread.Sleep(5000);
label1.Text =页面刷新为+ DateTime.Today.ToLongDateString()++ DateTime.Now.ToLongTimeString();
}
11 - 现在按Ctrl + F5运行你的网站
OUT PUT
12 - 当你点击按钮那么它看起来就像这样...
这里我不能告诉你输出图片只看下载附件..
13- 5秒后它将显示当前日期和你系统的时间。
Html5 Progreebar 您可以轻松添加到您的aspx页面
Asp.net Ajax Progressbar
Could you please any body help me how to implemnt Progress bar in asp.net and c#
解决方案
hi,
Search in Google...
ProgressBar for ASP.NET[^]
http://www.dotnetcurry.com/ShowArticle.aspx?ID=384[^]
http://www.dotnetfunda.com/codes/code1439-progress-bar-in-aspnet.aspx[^]
So follow these steps to create Display after application The Steps are: 1- Start -> All Programs -> Visual Studio 2005 or Visual Studio 2008 2- Now go to File Menu -> New -> Web Site 3- Under Visual Studio Installed Template-> Choose ASP.NET WEB SITE -> Choose File System from the location combo box -> Set the path by the browse button - > Choose the language from the Language ComboBox (Visual C# , Visual Basic , J #) Choose Visual C# 4 - Click on the OK Button:- First you have to learn XML and HTML to work with ASP .NET_ I have used to make the text as comment this is the way to make comment in this code … This is the Source Code window and in this page you will se this code… <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Type your webpage title here</title> <!– Here you can specify your page title in between title tag -> </head> <body> <form id="form1? runat="server"> <div> <!– In between div tags you can manage your web controls like buttons, labels, picture Box, ImageMap etc –> </div> </form> </body> </html> See here is a tab named Design in the bottom of this page 5- Click on this tab and you will see a blank web page where you can drag any control from the toolbox (which is in the left side of this window) 6-copy and .gif progress image and paste it into the solution explorer. 7- Now Drag some controls under the AJAX Extensions One scriptmanager One UpdatePanel One UpdateProgress And now set the source code window like this…. Under the form tag__ <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"> <ContentTemplate> <center> <div><asp:Button ID ="button1" runat="server" Text="Update Time/ Date" onclick="button1_Click"/> <br /> <asp:Label ID ="label1" runat ="server"></asp:Label> </div> </center> </ContentTemplate> </asp:UpdatePanel> <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1" DisplayAfter="2000" DynamicLayout ="true"> <ProgressTemplate> <center><img src="progress.gif" runat="server" /></center> </ProgressTemplate> </asp:UpdateProgress> 8- Now in the design window double click the button and type this code in the code window… protected void button1_Click(object sender, EventArgs e) { System.Threading.Thread.Sleep(5000); label1.Text = "Page refreshed at" + DateTime.Today.ToLongDateString() + "" + DateTime.Now.ToLongTimeString(); } 11 - Now run your web site by Ctrl + F5 OUT PUT 12-When you click on the button then it will seem like this… Here i can't show you the output picture to see just download the attachment.. 13- And after 5 seconds it will display the current date and time….of your system.
Html5 Progreebar you can easily add in your aspx page
Asp.net Ajax Progressbar
这篇关于Asp.net和C#中的ProgressBar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文