第一章 网页设计回顾

来源:互联网 发布:哪些淘宝店有福利看 编辑:程序博客网 时间:2024/04/28 08:17

网页发展史大致可以分成下面三个阶段
       HTMLHyperText Markup Language
       ASPActive Server Page
       ASP.NET             (著名的web设计开发语言还有JSP、PHP等)
ASP的缺点
      一件工作要多个程序来完成
      不是所有的都是面向对象的程序语言
      未做到输入资料的验证(需要自己单独写)
      未做到网页的信息安全
      不支持XML
ASP.NET改进了ASP的缺点,ASP.NET程序包含四大部分

       指引区域(directive block):夹在<%@….%>

      .NET代码区域(code declaration block):夹在<script ….></script>

    网页标签区域(tag block):夹在<html></html>

    动态标签区域(code render block):夹在<%….%>

  1. <%@ Page Language="VB" %>      指引区域
  2. <script runat="server">      .NET代码区域
  3. sub  SavHi(obj as Object, e as EventArgs)
  4.     lblMessage.Text = "Hi, " + tbName.Text + "你好"
  5. end sub
  6. </script>
  7. <html>                                            网页标签区域
  8. <head></head>
  9. <body>
  10.   <%Response.write("第一个ASP.NET程序")%> 动态标签区域
  11.     <br>
  12.     <asp:Label id="lblMessage" runat="server" Text="看过来" /><br>
  13.   <form runat="server">
  14.     请输入姓名:<asp:TextBox id="tbName" runat="server" /><br>
  15.     <asp:Button Text="发送" Onclick="SavHi" runat="server" />
  16.   </form>
  17. </body>
  18. </html>

ASP.NET的标签
    HTML Controls
       List Controls
       Rich Controls
       Validation Controls
       Web Controls
 HTML Controls   List Controls   Rich Controls   Validation Controls Web Controls HtmlAnchor   DataGrid   AdRotator   CompareValidator   Button   HtmlButton   DataList   Calendar   CustomValidator   CheckBox   HtmlForm   Repeater   Xml   RangeValidator   CheckBoxList   HtmlGenericControl     RegularExpressionValidator   DropDownList   HtmlImage     RequiredFieldValidator   HyperLink   HtmlInputButton     ValidationSummary   Image   HtmlInputCheckBox      ImageButton   HtmlInputFile      Label   HtmlInputHidden      LinkButton   HtmlInputImage      ListBox   HtmlInputRadioButton      Panel   HtmlInputText      RadioButton   HtmlSelect      RadioButtonList   HtmlTable      Table   HtmlTableCell      TableCell   HtmlTableRow      TableRow   HtmlTextArea      TextBox

 

 

 

 

 

 

 

 

 

 

 

 

   

                                                                  

                                                                                                                 

                                                                               

.NET代码区域和动态标签区域所用的语言都是Script语言,但是执行机制却不同。当用浏览器浏览网页程序代码时,ASP.NET先编译网页程序,其中:
    .NET代码区域,就会被编译成Object code,所谓的Microsoft Intermediate Language码,简称MSIL码,此MSIL码是储存在server中,只是为了让网页程序能快速的被执行。
    编译程序对网页标签区域的处理是将所有的标签都转换成HTML标签,如果原来就是HTML的标签则不会有变化,若是ASP.NET的标签就会被转换成HTML标签
    编译程序对动态标签区域的程序代码不是作compile,而是做interpret的动作,也就是动态标签区域的代码立即被解译成HTML标签,和转换后的网页标签区域一起传送到client端的浏览器。

转换后的代码

  1. <html>
  2. <head></head>
  3. <body>
  4.   第一个ASP.NET程序
  5.   <br>
  6.   <form name="ct10" method="post" action="test.aspx" id="_ct10">
  7.     <input type="hidden" name="_VIEWSTATE" value="dDwtNjIxOTc5MzA1O3Q8O2w8aTwwPjs+O2w8dDxwPHA8bDxUZXh0Oz47bDxIaSwg=" />
  8.     请输入姓名:<input name="tbName" type="text" id="tdName" />
  9.     <br>
  10.     <input type="submit" name="_ct1" value="发送">
  11.   </form>
  12. </body>
  13. </html>
原创粉丝点击