ÁÂÁÂæ£æ£
€p§Ì·Q§â±z©ÒŽ£ªºµ{Š¡œX§ï¬°CodeBehind, šÃ¥Ñ€@ÓButton šÓIJ°Ê
Šý°õŠæªº®ÉÔ, ŠbIEªº¥k€Uš€¥X²{: ºô¶¿ù»~ ªº°T®§
§Ú§ïªºµ{Š¡œXŠp€U: œÐ°Ý¿ùŠbþžÌ©O?
Default.aspx
--------------------------------------------------------------------------------------------------------------------------
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default2.aspx.vb"
Inherits="Default2" %>
<!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>
<META http-equiv="Content-Type" content="text/html; charset=big5">
<title>¶i«×ŠC</title>
<script language="vbscript">
<!--
Function SetProcessBar(Byval vPercent)
strPercent = CStr(CInt(vPercent * 100)) & " %"
tabPercent.width = strPercent
tdPrecent.innerText = strPercent
window.status = "¥Ø«e¶i«× " & strPercent
End Function
-->
</script>
</head>
<body>
<table width="100%">
<tr><td style="{border-top-style: groove; border-right-style: groove;
border-left-style: groove; border-bottom-style: groove;}">
<table id=tabPercent bgcolor=blue height=24px width="0%"><tr><td>
</td></tr></table>
</td></tr>
<tr><td id=tdPrecent align=center>50 %</td></tr>
</table>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" Text="Button" /></div>
</form>
</body>
</html>
Default.aspx.vb
--------------------------------------------------------------------------------------------------------------------------------
Partial Class Default2
Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
ProcessBarMain()
End Sub
Sub ProcessBarMain()
Dim ibt As Integer
For ibt = 1 To 40
Response.Write("<" & "script language=vbscript>SetProcessBar " &
CDbl(ibt / 40) & "</" & "script>" & vbNewLine)
Response.Flush()
System.Threading.Thread.Sleep(500)
Next
End Sub
End Class