Application of device filter for ASP.net 2.0 mobile development

Source: Internet
Author: User
Tags config manual visual studio

In the previous article I introduced devicespecific/choice constructs and device filters, which we did in the HTML view of the ASP.net mobile page or in the Web.config file of the site program Manual encoding to define device filters and Devicespecific/choice constructs. However, if you are using Visual Studio 2005, we can directly use a convenient, visual way to define Devicespecific/choice constructs and device filters, avoiding the complicated implementation process of manual encoding in the program, And because developers don't have direct code typing, it's not easy to get code spelling and grammatical errors.

Tip: Include a control named DeviceSpecific in the Mobile Web Forms tab of the Visual Studio 2005 Toolbox, and you can drag and drop the control into a form control or Panel control. Then when you switch the page to HTML view, you'll see that the corresponding form control or Panel control will contain the Devicespecific/choice construction syntax. One thing to note is that you can't take it for granted that dragging a DeviceSpecific control into other ASP.net mobile controls also implements the Devicespecific/choice constructs described above. A devicespecific/choice construct is automatically added to these controls only if you define a property override or define a templated option for the list control. The DeviceSpecific control is only available for defining templated options in a visual way in form controls and panel controls.

Creating and applying device filters

After you select a control on the ASP.net mobile page, you see the (AppliedDeviceFilters) item in the device-specific column of the Properties window, and we can click the ellipsis button on the right margin, and the Applied Device Filter dialog box pops up. The primary purpose of this dialog box is to apply device filters to controls in this state after editing the properties of the control, but it also allows you to define new device filters. And these well-defined device filters can be applied to the entire site program and all of the controls, ASP. NET automatically stores these newly defined device filters in the site program's Web.config file.

In the "Available device Filters" Drop-down list in the figure above, enumerates all the available device filters for the control that is currently editing the property. The lower list in the dialog box shows the device filters that the control that is currently editing the property is applied to. If you want to create a new device filter, you can click the Edit button on the dialog box. The Device filter editor pops up, as shown in the figure:

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.