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

?????? ????????? ?????? ?????????
???? ???????: 976112 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

????? ???

????? ??? ??????? ??? ????? ??? ??????? ????? ASP.NET ???????:
  • <% ... %>
  • <%= ... %>
  • <%@ ... %>
  • <%# ... %>
  • <%$ ... %>
  • <%-- ... %>
  • <%@ ... %>

??????? ????

<%... %> ????? ??? ????????? ????????

??? ??????? ??? ????????? ???????? ??????? ?????? ??? ??????? ?? ????????? ??????? ?? ASP ???????. ????????? ???????? ?? ?????? ???? ????? ??? ??????? ???????? ????? ?? ??? ?????? ??????? ????? ????? ????? ??????.

???? ?????? ?????? ???? ASP.NET ????? ????? ??? ????? ????????? ???????? Microsoft Visual Basic .NET ????? ????????? ?????? ????? ???? ??????? ????:
<%@ Page Language="VB" %>
<html>
<body>
    <form id="form1" runat="server">
    <% For i As Integer = 16 To 24 Step 2%>
    <div style="font-size: <% Response.Write(i)%>">
        Hello World<br />
    </div>
    <% Next%>
    </form>
</body>
</html>
??? ???? ????????? ?????? ????? ????? ????? "???? HTML ? ???? ?? ????? ?????? ??????? ?????????.

????? ?? ????????? ??? ??? ????????? ???????? ??????? ?? ????? ??? ASP.NET ?? ?????? ???? ???? ????? Microsoft (MSDN) ?????? ??? ?????:
http://msdn.microsoft.com/en-us/library/ms178135.aspx

<% = %> ??? ???????

<% = % > ??? ??????? ??? ?????? ???? ????????? ???????? ??????? ???? ????? ??? ????? Response.Write(?). ??? ?? ???? ????? ???? ??????? ??? ???? ?? ????? Int ?? ????? ?????.

??? ???? ??????? ???? ????? ????????? ???????? ?????? ????? ??????:
<%@ Page Language="VB" %>
<html>
<body>
    <form id="form1" runat="server">
    <%=DateTime.Now.ToString() %>
    </form>
</body>
</html>
???? ??? ?? ???? ??????? ????? ??? ?? ???? ????? ???? ??????. ???? ??? .NET Framework ??????? ??????? ??????? ????? ?? ??? ??????? ????? ??? ????? ??????.

?????? ??? ???? ?? ????????? ??? ????? ??? ????????? ?? ASP.NET ?? ?????? ???? MSDN ??????:
http://msdn.microsoft.com/en-us/library/6dwsdcf5.aspx

<% @... ??????? ?????? %>

??????? ?????? ?? ???? ?????? ???? ???? ??????? ??? ????????? ?????? ?????? compilers ???? ?????? ???????? ??? ?????? ?????? ????? ASP.NET ????? ??? (.aspx) ?????? ?????? ???????? (.ascx).

???? ??? ???? ASP.NET ???? ??????? ???????:
?? ??? ??????????? ??? ??????
???? @????? ?????? ?????? ?????? ???? ??? ????????? ?????? ???? ???? ASP.NET ? ?????? ??????? ???????. ???? ????? ??? ?? ????? .aspx.
* ???? ??????? ??? ?????? ??? ??? ?? ????? ASP.NET ????? ???.
@ ??????????? ?????? ?????? ?????? ???? ??? ????????? ?????? ???? ???? ASP.NET ? ?????? ??????? ???????. ???? ????? ??? ?? ????? .ascx (????? ?????? "????????").
* ???? ??????? ??? ????? ?????? ?? ???????? ??? ?????? ???????.
@ ???????????????? ????? ??? ???? ???? ?? ???? ?? ?? ???? ???? ??????.
@ implements???? ?????? ???? ??? ?? ???? ?? ???? ???? ?????? ???? ?????? ????? .NET Framework ????.
@ ????????? ???? ??????? ????????? ?? ?????? ????? ??? ????? ??????. ???? ??? ??? ????? ????? ???? ???????? ? ????? ???? ?????? ??????? ???? ????? ????? ??? ??????? ?? ?????? ???????? ?? ???? ???? ????????.
@ ??????????????? ????? ??? ?????? ??????? ????? ??????? ???????. ???? ???? ??????? ???? ??????? ?????? ????????? ?? ??????.
@ ????????????? ??? ???? ?????? ASP.NET.
@ WebHandler????? ??? ???? IHttpHandler ASP.NET.
@ PreviousPageType???? ????? ?????? ??? ????? ??? ?? ?????? ??????? ??? ?????? ????? ?? ???? ??????? PreviousPage.
@ MasterType????? ??? ??? ??????? ???????? ???? ASP.NET. ???? ????? ?????? ???? ????? ???? ??? ???? ?????? ASP.NET.
@ OutputCache???? ?????? ?????? ??????? ??????? ?????? ???? ?? ???? ?? ???? ???? ????????.
@ ???????? ?????? ????? ???? ???? ???? ?? ???????? ??? ???? ?????? ???? ?? ???????? ??????.
????? ?? ????????? ??? ???? ?????? ?????? ?? ?????? ???? MSDN ??????:
http://msdn.microsoft.com/en-us/library/xz702w3e.aspx

<% #... ??????? %> ??? ????????

????? ????? ??? ???????? ????? ??? ????? ???? ???? ???? ???? ?????? ????? ??? ??????? ????? DataBind ???? ?????? ????? ?????? ??? ?????? ??? ??????.

???? ?????? ?????? ????? ??????? ????? ??? ???????? ???? ??????? ?? ???? ??????? Text ?????:
<%@ Page Language="VB" %>
<script runat="server">
    Protected Function SayHello() As String
        Return "Hello World"
    End Function

    Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs)
        lblHello.DataBind()
    End Sub
</script>
<html>
<body>
    <form id="form1" runat="server">
    <asp:Label ID="lblHello" runat="server" Text="<%# SayHello%>"></asp:Label>
    </form>
</body>
</html>
????? ?? ????????? ??? ???? ???? ????? ??? ???????? ?? ?????? ???? MSDN ??????:
http://msdn.microsoft.com/en-us/library/bda9bbfx.aspx

<% $... %> ???? ???????

??? ??????? "???? ???????" ????? ??? ????? ????? ?????? ???????? ??? ????????? ???????? ?? ????? ??? ????????? ?? ????? ???????. ?????? ?? ???? ???? ?????? ???? ???????:
< ????? ??????? $ %: ???? ????? %>
???? ????? ??????? ($) ??? ASP.NET ?? ??????? ?????? ???? ?????. ????? ????? ??????? ??? ??????? AppSettings ?? ConnectionStrings ?? ?????. ???????? ??? ???? ????? ????? ?????? ???? ??????? ????? ??. ???? ??????? ???? ??? ???????? (:) ?? ASP.NET ??? ?????? ???????? ???? ????? ?????.

????? ????? ???????? ?????? ????? ??????? "???? ???????" ?????? ??? ???? ????? ?? ???? ??? ?? ???? AppSettings ?? ??? Web.config ????? ?? ????? ??????? ???? ????? ??? ???? ??????? Text ????.

???? AppSettings ?? ??? Web.config:
<appSettings>
    <add key="copyright" value="(c) Copyright 2009 WebSiteName.com"/>
</appSettings>
???? ??????? ?? ???? ????? ??? ASP.NET:
<div id="footer">
    <asp:Literal ID="Literal1" runat="server" Text="<%$ AppSettings: copyright %>"></asp:Literal>
</div>
?????? ??? ???? ?? ????????? ??? ????????? ASP.NET ?? ?????? ???? MSDN ??????:
http://msdn.microsoft.com/en-us/library/d5bd1tad.aspx

<%--...--????????? %> ?? ???? ?????? ???

???? ????????? ?? ???? ?????? ???? ???????? ????? ??????? ????????? ???????? ?? ?? ???? ???? HTML ?????? ????? ??? ASP.NET (??? ??? ??? ????????? ???????? <script>). ?? ??? ?????? ??? ?????? ?? ????? ??? ?????? ????? ?????? ??? ???? ????????? ?? ???? ?????? ?? ??????? ??? ?????? ???????.

???? ?????? ????????? ???????? ?????? ????? ??????? ???? ????????? ?? ???? ?????? ?? ???? ASP.NET:
<%@ Page Language="VB" %>
<script runat="server">
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim strName As String
        strName = Session("userName")
        lblUserName.Text = strName
    End Sub
</script>
<html>
<body>
    <form id="form1" runat="server">
    <%-- Label for UserName --%>
    <asp:Label ID="lblUserName" runat="server" Text=""></asp:Label>
    </form>
</body>
</html>
????? ?? ????????? ??? ????????? ?? ???? ?????? ?? ?????? ???? MSDN ??????:
http://msdn.microsoft.com/en-us/library/4acf8afk.aspx

???????

???? ???????: 976112 - ????? ??? ??????: 01/?? ??????/1430 - ??????: 2.0
????? ???
  • Microsoft .NET Framework 2.0
  • Microsoft .NET Framework 3.0
  • Microsoft .NET Framework 3.5
????? ??????: 
kbmt kbsurveynew kbinfo kbhowto kbexpertiseadvanced KB976112 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????976112

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

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com