23. Question: How many ways are there to read HTML form fields in an ASP file?
Answer: In addition to reading parameters attached to the URL, the Request object can also read the content of HTML form fields. The commonly used syntax structure is as follows:
< Form name =Formname method=Get|PostAction=URL>< Form >
The method can accept two methods of transmission: Get or Post. Post is a method that allows the transmission of a large amount of data. The Get method will attach the data to be transmitted behind the URL and then deliver it to the server together, so the amount of data transmitted is It will be limited, but the execution efficiency is better than the Post method.
Use Get or Post methods to send data to the server. The corresponding method of using the Request object to receive data is as follows:
Get: Request.QueryString (field name), or can be written as Request (field name)
Post: Request.Form (field name), or can be written as Request (field name)
24. Question: How to improve the efficiency of using Request collections?
A: When using a Request collection, this is much slower than accessing a local variable because it contains a series of searches for the related collection. Therefore, if you intend to use a value from the Request collection multiple times in the page, you should consider storing it as a local variable.
25. Question: You can use VBscript or Jscript in the ASP page. Can you mix script engines?
A: Although you can use both VBscript and Jscript in the ASP page. However, it is not advisable to use both Jscript and VBscript on the same page. Because the server has to instantiate and try to cache two (not one) script engines, this adds to the system burden to some extent. Therefore, from a performance perspective, multiple scripting engines should not be mixed in the same page.
26. Problem: When we create an ASP file and comply with the syntax, enter the following address through the browser, or open browsing through the explorer: c:/inetpub/wwwroot/a.asp, an error that cannot be run will occur. And prompt that the permissions are incorrect or the file cannot be accessed, why can't the ASP file run normally?
Answer: This is because the ASP file first requires the site to have the execution (script) attribute; then it requires the address to be entered in the URL format, rather than the DOS format. We need to install and start the Web service platform on the computer and ensure that the ASP file is stored. In the virtual directory of the web server, you can browse through HTTP format. Enter: http:// Web site name (or site IP address)/ASP file name in the browser's address bar. After entering, you can The browser sees the result of the server executing the ASP file.
27. Question: What is ASP.NET? What does it have to do with ASP?
Answer: Active Server Pages (ASP, active server page) is a relatively simple programming environment, in which you can use HTML, scripting language and a small number of components to create server-side Internet applications;
ASP.NET is a powerful programming environment promoted by Microsoft. It can use C# and other high-level languages, scripting languages, HTML, XML, XSL, etc. to create web-based applications. ASP.NET uses C# as an object-oriented language, and in many ways, C# will become Microsoft's Java-like language. C# is one of the most important features in ASP.NET development, and Microsoft will develop C# into a strong rival to Java. This is also an important part of Microsoft's .Net framework. I think C# is the main tool for Microsoft to beat its opponents in the programming language field.
ASP.NET is superior to ASP programs in object orientation, database connections, large site applications, etc. ASP.NET also provides more new features in other aspects, such as: built-in object caching and page result caching; built-in XML Supported, can be used for simple processing of XML data sets; server control provides more interactive system, etc.
ASP.NET is still completely locked in Microsoft's operating system. To truly realize the potential of ASP.NET, you have to use C# or vb.net. These two languages will become the core scripting languages of the ASP.NET standard.