Get your homepage to support a variety of browsing devices (asp+) (Part One)

Source: Internet
Author: User
Tags html page interface range what is asp
Mobile control of asp+ asp+
If media news and advertising are to be believed, we will be using small phones or other mobile devices to access the Internet in the near future. OK, this is just a more optimistic estimate, but one thing is for sure, it's that visitors to your site already have a lot of people who are not using traditional browsers, and that number is increasing (SINA News: According to statistics, global mobile phone users have exceeded computer users, and 30% Mobile phone with WAP function). To accommodate a variety of mobile phones (including those that are small), Asp+ offers a proud service control to produce WML, not HTML. In this article, we will take a small look at the control that Microsoft is still developing. This article will also consider some other user browsing equipment, such as the top box, or even the refrigerator (haha, is not feeling some days night pool).

Getting Started with asp+
There are a number of ways to create dynamic pages. In the past, the most prominent technique was to use an executable program to access a Web server through Common Cateway interface (CGI). However, in recent years, new technologies have enabled scripting code to be written directly into HTML pages, and these technologies are becoming increasingly popular. In these technologies are Perl,java server Page (JSP) and Microsoft's Active Server Pages (ASP).

The ASP begins with a DLL that can access the Web server through the Internet Server Application Programming Interface (ISAPI), in other words an ISAPI DLL. This interface provides a fast and reliable connection to the server. The code runs in the same process or in the memory space. With this technology, the ASP evolves to 3.0 and is installed as part of Windows 2000.

Into the. NET World (the new concept that Microsoft brings to us)
Based on the introduction of Microsoft. NET Frameword, the design of the underlying ASP has changed. This new structure has been completely divorced from the language that the current program runs and the limitations of the operating system's specified structure.

Today, most programming languages can direct the native code (which has been executed in the process, commonly said to be the compiler) to compile the original code. Therefore, this compilation must depend on the type of processor. For example, code compiled on an Intel processor will not run on a Motorala processor.

One exception to this is Java, which uses a separate virtural machine to execute code that is compiled according to the specified processor and operating system. As long as there is a suitable Java Virtual Machine on the target, the code can be executed.

Microsoft's. NET framework is a much more extensive framework that is very similar to Java. It provides a complete development and running environment, and it can run programs. The code is compiled into a special intermediate Language (IL). All the source code is compiled into IL code without regard to the language in which the code is used.

Because of the code whether VB, VC, JScript or New C #, will be compiled into the same IL code. These compilers are already included as part of the. NET Framework.




The asp+ Framework

To combine ASP technology with the. NET Framework, Microsoft has developed a development system to provide a faster dynamic web development. At the same time, the operating environment will become more efficient, upgrade also has a great improvement. This technique is called active Server page+ or simply called asp+

How does the asp+ work?
The main new feature of asp+ is the combination of application and page event modules. Asp+ is part of this new code processing environment. This means that the new technology can react to events, such as the loading of a page or the launch of an application, which can be handled by events. asp+

The structure of this background execution can be very useful for the page. Typically this page includes a <form> tag and some other HTML elements, but these elements are executed on a server with a asp+ environment. Asp+ not only exports the requested HTML to the browser (client), but also adds some extra stuff inside to maintain the value of each control (used to back to the server), which is strange, but we have to accept that. Just like we accept the ASP.

And because asp+ controls the way the page behaves through additional code and attributes, asp+ can do more fun things. Because the page was created on the server, the asp+ engine was able to find out how the form was submitted, which means it could detect which button buttons the user pressed.

asp+ allows server-side events to be used (this is a new concept). We'll see in the example below to handle the problem with the specified event.

This special HTML element request is the foundation of this new background structure, and its real name is asp+ Server Controls (asp+ service control). There are many such controls in the standard asp+. You can use VB or other. NET support languages to write, inherit, and extend this control.

What is asp+ mobile control?
A big concern for Web developers now is the rapidly growing market for mobile devices. There are hundreds of different types of devices that are now available, and none of these products can be compatible with browsers on traditional PCs. This range includes, but is not limited to, wireless devices. There are also handheld computers, our TVs, and game consoles, which are now available online.

Most of these devices are not HTML and also do not support changes in colors, fonts, positioning, sounds, and various other elements. Therefore, creating an HTML page for your site does not solve all the problems. So we have to create a page that can be displayed for most devices. (Hey, think, if a device is writing a page, you ....) )

To provide this attribute, Microsoft introduced a mobile control, which can create different pages based on different devices. If it is WAP mobile browsing, he will create WML code, if the handheld computer browsing will create HTML code, IE and other traditional browsers will not say.

The focus of this control is the ability to intelligently create different outputs, while you use the same code for different devices. For example, list control displays the same list menu on the phone, on the handheld, and on the PC, but the code they use to display the output is different.

With him, programmers can develop programs without thinking about the devices that customers use.

What can mobile control do?
Now let's look at what mobile controls can do:

Range of mobile controls
The following properties are valid for the current version of the move control:

MobilePage like the deck in WML
Panel as a card in WML
Form enables user Input control
Label prints text on a page
Command to create a link
TextBox text Input Box
List as Select
RequiredFieldValidator to check user input
RegularExpressionValidator use user input to take effect
Stylesheet Specify output format
There is also a SelectionList control in later releases, which is roughly the same as the list.

Set this component
Creating a mobile control is simple, although these specific technologies have been changing, but these controls are still a DLL file that copies them to the bin subdirectory of the development environment directory. Of course, this application must also be a virtual directory.

The second step is to add the example file Config.web to the application directory, and if the file already exists, add the contents of the <browsercaps> section of the document. It uses Browsercapabilities control to determine which format and language will be sent to the user side.

In the current release, mobile controls only support WML on WAP phones, as well as HTML. Later versions will support a lot. Like Xhtml,hdml,chtl and so on.

This article from the Http://www.aspcn.com ASP China Network If you want to reprint please be sure to indicate the source, thank you



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.