IIS5 and IIS6.0 of ASP. NET

Source: Internet
Author: User

Since html and http are available, browsers and Web servers are available, and Web applications are available. The initial interaction mode is as follows:

This mode has been running well for many years. However, with the development of computer applications, people are increasingly not satisfied with pages with only static content, and the demand for Dynamic html and other code generation by some mechanism is becoming more and more urgent. Therefore, many technologies have emerged, ASP. NET is such a technology. Essentially, ASP. NET is a technology that allows servers to dynamically generate codes recognized by browsers such as html, css, and javascript. The interaction mode of ASP. NET is as follows:

The figure shows that ASP. NET must solve two major problems: first, how to interact with the Web Server (IIS), and second, how to generate different html code based on different requests.

First, according to different IIS versions 5, 6.0, 7.0), ASP. NET has different process modes and different interaction modes, which are not described in this article. In general, you do not have to worry about this issue. To understand this issue, you must understand the models of different versions of IIS, and each version has its own differences. Therefore, I am not going to discuss this issue. If you are interested, you can search for relevant information on your own.

Let's discuss the second question. The first thing to note here is that because the IIS7.0 process mode has changed a lot, I didn't know the IIS7.0 model either. Therefore, the descriptions below and later will only apply to IIS5 and IIS6.0. we have reason to think that the descriptions for IIS5 and IIS6.0 are also applicable to IIS7.0.

Let's take a look at the code asking Yudi to put the elephant in the refrigerator. Why is it not God? Because I am not in the control of China), please follow my ideas first, don't worry, don't worry.

 
 
  1. UsingSystem;
  2.  
  3. NamespaceConsoleApplication3
  4. {
  5. ClassProgram
  6. {
  7. StaticvoidMain (string [] args)
  8. {
  9. Emperoremperor=NewEmperor();
  10. While (true)
  11. {
  12. Console. WriteLine ("first prepare the elephant and refrigerator for the Jade Emperor. ");
  13.  
  14. Console. WriteLine ("enter the name of the elephant :");
  15. StringelephantName=Console. ReadLine ();
  16. Console. WriteLine ("input elephant weight :");
  17. IntIntelephantWeight= Int. Parse (Console. ReadLine ());
  18. Console. WriteLine ("Enter the refrigerator name :");
  19. StringrefrigeratorName=Console. ReadLine ();
  20.  
  21. Elephantelephant=NewElephant()
  22. {
  23. Name=ElephantName,
  24. Weight=ElephantWeight 
  25. };
  26. Refrigeratorrefrigerator=NewRefrigerator()
  27. {
  28. Name=RefrigeratorName 
  29. };
  30.  
  31. Contextcontext=NewContext()
  32. {
  33. Elephant=Elephant,
  34. Refrigerator=Refrigerator 
  35. };
  36.  
  37. Emperor. ProcessRequest (context );
  38.  
  39. Console. WriteLine ("do you want Yudi to keep the elephant in the refrigerator? ");
  40. Stringanswer=Console. ReadLine ();
  41. If (Answer= "N ")
  42. Break;
  43. }
  44. }
  45. }
  46.  
  47. ClassEmperor
  48. {
  49. PublicvoidProcessRequest (Contextcontext)
  50. {
  51. Elephantelephant=Context. Elephant;
  52. Refrigeratorrefrigerator=Context. Refrigerator;
  53.  
  54. // Step 1: open the refrigerator door
  55. Refrigerator. IsOpen=True;
  56. Console. WriteLine (string. Format ("Yu Di opened the {0} refrigerator door. ",
    Refrigerator. Name ));
  57.  
  58. // Step 2: Put the elephant in
  59. Refrigerator. Content=Elephant;
  60. Console. WriteLine (string. Format ("Yu Di put the elephant {0} into the refrigerator {1. ",
    Elephant. Name, refrigerator. Name ));
  61.  
  62. // Step 3 close the refrigerator door
  63. Refrigerator. IsOpen=False;
  64. Console. WriteLine (string. Format ("Yu Di closed the {0} refrigerator door. ",
    Refrigerator. Name ));
  65. }
  66. }
  67.  
  68. ClassElephant
  69. {
  70. PublicstringName {get; set ;}
  71. PublicintWeight {get; set ;}
  72. }
  73.  
  74. ClassRefrigerator
  75. {
  76. PublicstringName {get; set ;}
  77. PublicboolIsOpen {get; set ;}
  78.  
  79. Privateobjectm_Content;
  80. PublicobjectContent
  81. {
  82. Get {returnthis. m_Content ;}
  83. Set
  84. {
  85. If (! This. IsOpen)
  86. ThrownewInvalidOperationException ("the refrigerator door is not opened and cannot be placed. ");
  87. If (this. m_Content! = Null)
  88. ThrownewInvalidOperationException ("there is something in the refrigerator and it cannot be put into new things. ");
  89.  
  90. This. m_Content=Value;
  91. }
  92. }
  93. }
  94.  
  95. ClassContext
  96. {
  97. PublicElephantElephant {get; set ;}
  98. PublicRefrigeratorRefrigerator {get; set ;}
  99. }
  100. }
  1. DataList and Repeater controls of ASP. NET
  2. Analysis of IIS ing in ASP. NET
  3. Overview ASP. NET status types
  4. Introduction to ASP. NET and Web servers
  5. EnableViewState attribute of ASP. NET

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.