????? ????? ASP.????? ??? NET

2013 年 3 月 9 日5530

|

?????? ??? ?????? ??????? ???? ?????? ???? ????? ??????

???? ??? ????? ??????? ?????? ????? ?????? ?????? ?? ASP.NET

???????.

????? ??????? ?????? ?? ASP.NET ???? ??

???? ?????? ?? ???? ??????? ??? ?????? ???? ????? ?

????? ???????.

???????

?????

???? ??????? ??????? ?? ??????? ?????? ??? ???????? ???????

?????? ????????? ???? ??????? ???? ???????:Microsoft Visual Studio.NET????? ??????? ?????? ? Microsoft (IIS)

5.0????

????? ??????? ??? ????? ?? ???????? ???????: ??????? ???Microsoft ASP.NET

???? ????

????? ????? ASP ??????? ????? ????

??? ???????? Response.Write ???? ????????? ???????? ????? ??? ????????? ?

?????? ???????. ??? ???? ?? ????? ?????? ??????? ??? ???

??????? ????? ??? ???? ???????? ????? ??????????.

????? ASP.???? NET

????? ???? ????? ???????? ????? ???. ????? ??????? ?????? ??????

????? ??????? ????? ?? ?????? ?????? ???????? ?????? Response.Write . ??? ????? ?? ???? ????? ???????? ??????? ?????? ?? ????? ??

?????? ??? ??? ?????.

????? ????? ???? ???

????? ?????? ??????? ??? ????? ?????? ?? ????? ????????

?????? ?????? ?????? ?????? ??????. ????? ???? ?????? ?? ????

???? ??????? ??? ?????? ???? ?????????? ??? ????? ????? ???????.

????? ???? ASP.NET ??????? ?????? ???? ?????? ?????? ???????

???? ??????? ?????? ASP ????.????? ??? NET

???? ???? ?????? ?????? ??? ????? ???? ??????? ???

??????. ??? ????? ???? ???? ?????? ????? ? ???? ??? ????? ????? ????

?? ASP.???? ????:

    ??? ????? Microsoft Visual Studio.NET.????? ???? ASP Visual Basic.????? ????? ??? NET.

    ????? ???????????????????.?? WebForm1.aspx? ?? ???????? ??? ????? ??? HTML.???? ?? ???? ???????? ???????? ??????? ??? ????? ?

    ????? ?????? FORM.

    ?????? ??? ??? ???? ???????? ????????? ???? ?????????? ???????? ? HTML. ?????? ????? ???? ?????? ? HTML ??? ????? ???????.

    ??? ????? ????????? ????????? ?????? ?????? ????? ?????

    ?? ?????. ??? ????? ??? ?? ?????? ???? ???????? ???????? ???????

    ????? ????? ??????? ??? ??????.





    <TABLE cellSpacing="1" cellPadding="1">







    <TR><TD>



    <asp:Label runat="server">First Number:</asp:Label>



    </TD>



    <TD>



    <asp:TextBox runat="server"></asp:TextBox>



    </TD></TR>



    <TR><TD>



    <asp:Label runat="server">Second Number:</asp:Label>



    </TD>



    <TD>



    <asp:TextBox runat="server"></asp:TextBox>



    </TD></TR>



    <TR><TD>



    <asp:Label runat="server">Sum:</asp:Label>



    </TD>



    <TD>



    <asp:TextBox runat="server"></asp:TextBox>



    </TD></TR>



    <TR><TD>



    <asp:Button runat="server" Text="Add Numbers"></asp:Button>



    </TD>



    <TD>



    </TD></TR>



    </TABLE>



    ???? ??? ????? ???? ?? ??????? ??????

    ??????? ?????? ?????? "??????? ??????" ??????? ??? ????? ??? ???????.???? ????? ??????? ??? ????? ????? ???? ????????? ????????

    ?????? ????? ??? ????? Click ??? ?????.????? ???????? ???????? ??????? ??? ????? ???????.





    Dim intTotal as integer



    Dim intFirstNumber as integer



    Dim intSecondNumber as integer







    ' Get the values from the input boxes.



    intFirstNumber = CInt(txtFirstNumber.Text)



    intSecondNumber = CInt(txtSecondNumber.Text)







    ' Get the total and display it.



    intTotal = intFirstNumber + intSecondNumber



    txtSum.Text = CStr(intTotal)



    ??? ????? ?????? ?? ????????? ???????? ?? ????? Button1_Click .





    intTotal = intFirstNumber + intSecondNumber



    ???? F9 ?????? ???? ???? ??? ??? ????.

    ???? ????

    ???? ???? ??? ????? ?? ???????? ????????.??? ?????. ????? ?????? ???????. ?????? ????? ???? ?????? ????? ??? ????? ??????? ???????.

    WebForm1

    ???? ??? ??????. ????? ???? ??????? ????? ????? ???? ???? ??

    ???????.???? ????? ?? ?? ?? ????? ?????? ??????? ????? ???????? ?

    ?? ???? ??? ????? ???.

    ?????? Visual Studio.NET

    ???? ???? ??????? ????????? (IDE) ?? ?????? ????? ????????? ????????

    ??? ?????? ??? ???? ???????. ????? ??????? ?????? ?????? ????

    ??????? ????????? ?????? ??? ??????? ??????. ????? ????? ???? ??

    ?????? ?? ??????? ????? ??? ????????? ?? ???????. ??? ?????

    ???? ?????? ????? ???????.??? ????? ??????? ???????? ???? ????????? ??????? ????? ???????.

    WebForm1 ???? ??? ?????? ????? ??????? ?? ??????? ??????

    ????.???? ?????? ??? ??????? ??? ?????? Visual Studio.NET

    IDE.??? ????? ??????? ???????? ???? ??? ?? ?????? ????? ????

    ???? ?????? ?????? ???? ???? ?????? ?? ???????.

???? ?? ??? ????

??? ????? ??? ????? ???? Visual Studio

.???? NET IDE ?? ?????? ?????? ????????? ???????? ??? ??????? ??? ?????? ???

??? ????? ???? ????.

????? ???? ????? ?????? ??? ASP.????? NET

???? ??????? ?????? ?????? ????? ??? ??????

???? ??????? ?????. ???? ???? ????? ???? ????? ?????? ??? ?????? ??????? ??? ?? ???? ????? ??????

??? ?????????. ??? ?????? ???? ?????? ?????? ??????? ?

??????? ???????:

    ?? WebForm1.aspx? ?? ???????? ??? ????? ??? HTML. ??? ?? ???

    ??? ???? ????? ?????? ?????? ?? ???? ???? ????????? ????????.





    Trace=True



    ???? ??? ?????? WebForm1.aspx? ?? ???? ?????? ????????? ????????.?? ????? Button1_Click ? ?????? ?????? ?????? ???? ???????

    ????????? ??? ??? ???? ?????? ?? ???????.

    ??? ???? ???????

    ??????? ????? ????? ??? ???.





    Trace.Write("Button1_Click", "Entering the Add routine")







    Dim intTotal as integer



    Dim intFirstNumber as integer



    Dim intSecondNumber as integer







    ' Get values from the input boxes.



    intFirstNumber = CInt(txtFirstNumber.Text)



    intSecondNumber = CInt(txtSecondNumber.Text)



    Trace.Write("Button1_Click", "Amount to add:" & _



    CStr(intFirstNumber) & " and " & CStr(intSecondNumber))







    ' Get the total and display it.



    intTotal = intFirstNumber + intSecondNumber



    Trace.Write("Button1_Click", "Total:" & CStr(intTotal))



    txtSum.Text = CStr(intTotal)







    Trace.Write("Button1_Click", "Leaving the Add routine")



    ???? ??? ???.??? ????? ??????? ???????? ???? ?????? ????? ?????? ?????? ???????.

    WebForm1

    ???? ??? ??????. ???? ??????? ?????? ???????? ???

    ???? ??????? ???? ?????????? ????? ?????

    ????? ?????? ??? ?????? ???? ????? ???????? ?? ????? ?? ???? ???

    ?????.????? ??????? ?? ????? ?????? ??????? ????? ???????? ???? ???

    ???? ??? ????? ???.

    ???? ??????? ?? ???????

    ???? ???????. ????? ????? ?????? ?????? ?? ????? Button1_Click ?? ??????? ??????????.

???? ?? ??? ????

?? ????? ?????? ????? ??????? ?? ??????? ?????? ???

??? ??? ??????. ??? ??? ?????? ??? ????? ??? ???

???? ????? ?????? ?????? ?? ????? Button1_Click ?? ??????? ?????? ????.

????? ????? ???





&amp;lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;&amp;gt;



&amp;lt;html&amp;gt;



&amp;lt;head&amp;gt;



&amp;lt;title&amp;gt;WebForm1&amp;lt;/title&amp;gt;



&amp;lt;meta name=&quot;GENERATOR&quot; content=&quot;Microsoft Visual Studio.NET 7.0&quot;&amp;gt;



&amp;lt;meta name=&quot;CODE_LANGUAGE&quot; content=&quot;Visual Basic 7.0&quot;&amp;gt;



&amp;lt;meta name=&quot;vs_defaultClientScript&quot; content=&quot;JavaScript&quot;&amp;gt;



&amp;lt;meta name=&quot;vs_targetSchema&quot; content=&quot;http://http://www.zjjv.com///intellisense/ie5&quot;&amp;gt;



&amp;lt;/head&amp;gt;



&amp;lt;Script language=&quot;vb&quot; runat=&quot;server&quot; id=&quot;script1&quot;&amp;gt;



Sub Button1_Click(Sender as object, e as EventArgs)



Trace.Write(&quot;Button1_Click&quot;, &quot;Entering the Add routine&quot;)







Dim intTotal as integer



Dim intFirstNumber as integer



Dim intSecondNumber as integer







&apos; Get the values from the input boxes.



intFirstNumber = CInt(txtFirstNumber.value)



intSecondNumber = CInt(txtSecondNumber.value)



Trace.Write(&quot;Button_Click&quot;, &quot;Amount to add:&quot; &amp;amp; CStr(intFirstNumber) &amp;amp; &quot; and &quot; &amp;amp; CStr(intSecondNumber))







&apos; Get the total and display it.



intTotal = intFirstNumber + intSecondNumber



Trace.Write(&quot;Button1_Click&quot;, &quot;Total:&quot; &amp;amp; CStr(intTotal))



txtTotal.value = CStr(intTotal)







Trace.Write(&quot;Button1_Click&quot;, &quot;Leaving the Add routine&quot;)



End Sub



&amp;lt;/Script&amp;gt;



&amp;lt;body MS_POSITIONING=&quot;GridLayout&quot;&amp;gt;



&amp;lt;form id=&quot;Form1&quot; method=&quot;post&quot; runat=&quot;server&quot;&amp;gt;



&amp;lt;asp:Label id=&quot;lblFirstNumber&quot; runat=server Width=125&amp;gt;



First Number:



&amp;lt;/asp:Label&amp;gt;



&amp;lt;input id=txtFirstNumber type=text size=5 maxlength=3



runat=server NAME=&quot;txtFirstNumber&quot;/&amp;gt;



&amp;lt;br&amp;gt;



&amp;lt;asp:Label id=&quot;lblSecondNumber&quot; runat=server Width=125&amp;gt;



Second Number:



&amp;lt;/asp:Label&amp;gt;



&amp;lt;input id=txtSecondNumber type=text size=5 maxlength=3



runat=server NAME=&quot;txtSecondNumber&quot;/&amp;gt;



&amp;lt;br&amp;gt;



&amp;lt;asp:Label id=&quot;lblTotal&quot; runat=server Width=125&amp;gt;



Total:



&amp;lt;/asp:Label&amp;gt;



&amp;lt;input id=&quot;txtTotal&quot; type=text size=5 maxlength=5



runat=server NAME=&quot;txtTotal&quot; readonly/&amp;gt;



&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;



&amp;lt;input type=submit id=Button1 value=&quot;Add Numbers&quot; onserverclick=&quot;Button1_Click&quot;



runat=server NAME=&quot;Button1&quot;/&amp;gt;



&amp;lt;/form&amp;gt;



&amp;lt;/body&amp;gt;



&amp;lt;/html&amp;gt;



"?><%@ Page Language="vb" Trace=true%>



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">



<HTML>



<HEAD>



<title>WebForm1</title>



<meta content="Microsoft Visual Studio.NET 7.0">



<meta content="Visual Basic 7.0">



<meta content="JavaScript">



<meta content="http://http://www.zjjv.com///intellisense/ie5">



<Script language="vb" runat="server">



Sub Button1_Click(Sender as object, e as EventArgs)







Trace.Write("Button1_Click", "Entering the Add routine")



Dim intTotal as integer



Dim intFirstNumber as integer



Dim intSecondNumber as integer







' Get values from the input boxes.



intFirstNumber = CInt(txtFirstNumber.Text)



intSecondNumber = CInt(txtSecondNumber.Text)



Trace.Write("Button1_Click", "Amount to add:" & _



CStr(intFirstNumber) & " and " & CStr(intSecondNumber))







' Get the total and display it.



intTotal = intFirstNumber + intSecondNumber



Trace.Write("Button1_Click", "Total:" & CStr(intTotal))



txtSum.Text = CStr(intTotal)







Trace.Write("Button1_Click", "Leaving the Add routine")







End Sub



</Script>



</HEAD>



<body MS_POSITIONING="GridLayout">



<form method="post" runat="server">



<TABLE cellSpacing="1" cellPadding="1">



<TR>



<TD><asp:Label runat="server">First Number:</asp:Label>



</TD>



<TD>



<asp:TextBox runat="server"></asp:TextBox>



</TD>



</TR>



<TR>



<TD>



<asp:Label runat="server">Second Number:</asp:Label>



</TD>



<TD>



<asp:TextBox runat="server"></asp:TextBox>



</TD>



</TR>



<TR>



<TD>



<asp:Label runat="server">Sum:</asp:Label>



</TD>



<TD>



<asp:TextBox runat="server"></asp:TextBox>



</TD>



</TR>



<TR>



<TD>



<asp:Button runat="server" Text="Add Numbers"></asp:Button>



</TD>



<TD>



</TD>



</TR>



</TABLE>



</form>



</body>



</HTML>

|

?????? ??? ???? ?? ?????????? ?? ?????? Microsoft ???????

????? ??? ? MSDN ??????:

.aspx http://http://www.zjjv.com///en-us/library/aa309369 (VS.71)

(http://http://www.zjjv.com///en-us/library/aa309369(VS.71).aspx)

http://http://www.zjjv.com///en-us/library/ms972204.aspx

(http://http://www.zjjv.com///en-us/library/ms972204.aspx)

?????? ??? ???? ?? ??????????

???? ??? ??? ??????? ?????? ?????? ?? Microsoft

????? ???????:

306172

(http://http://www.zjjv.com///kb/306172/

)

??? ??????? ??????? ??? ????? ASP.NET ????????? ?? Visual Studio.NET

|

???? ???????: 316726 - ????? ??? ??????: 29/???/1433 - ??????: 1.0

????? ???

Microsoft ASP.NET 1.1Microsoft ASP.NET 1.0

????? ??????:

kbdebug kbhowtomaster kbide kbwebforms kbmt KB316726 KbMtar

????? ????

???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????

???? ??? ????? ??????? ?????? ??????????316726

(http://http://www.zjjv.com///kb/316726/en-us/

)

|

0 0