WAP之家:为您提供最全最新的WAP技术,CP.SP.3G等行业资讯。 WAP之家交流论坛全新开放 点击进入>>
WAP资讯 | 3G动态 | SP动态 | 运营商动态 | 内容商动态 | 制造商动态 | 论坛讨论>> 每次自动访问
WAP技术 | WAP源码 | 手机编程 | 手机源码 | 无线技术 | J2ME技术 | 手机软件 添加到收藏夹
IVR技术 | SP资料 | SMS MMS技术 | 商业方案 | IVR下载 | 书籍教程 | 工具软件 语言:繁體中文

WAP之家技术文章WAP教程网站教程ASP.NET Mobile StyleSheet Control

ASP.NET Mobile StyleSheet Control
作者:佚名  来源:本站整理  发布时间:2008-3-14 20:47:27

Definition and Usage
定义和用法

The StyleSheet control defines styles to apply to other controls.
样式表控件的作用是:为控件定义样式。

The StyleSheet control can contain any number of <Style> elements. Each Style element must have a unique name. The name may be used to refer to each Style element from other controls on the same page.
样式表控件可能包含所有的<Style>元素。每个元素必须拥有一个独立的名称。该名称可用于来自同一页面上其它控件的样式元素。

A mobile page can also use an external style sheet. To create an external style sheet, you create a user control and a StyleSheet control in an .ascx file. To refer to this file, you add a StyleSheet control on a page and set its ReferencePath property to the URL of the .ascx file.
一个移动页面可以使用一张外部样式表。你可以在 .aspx 文件中创建用户控件和样式表控件,从而建立外部样式表。你可以在页面上添加样式表控件,并设置其ReferencePath属性的URL为 .ascx 的路径,从而导入外部样式表。


Properties
属性

Property
属性
Value
Description
描述
id unique_name Optional. A unique id for the control
可选参数。为控件指定一个独立的id
ReferencePath URL Optional. Specifies a relative path to an .ascx file that contains a set of style elements
可选参数。指定一个包含一组样式表元素的 .ascx 文件的相对路径
runat "server" Required. Specifies that the control is a server control
必要参数。指定该控件为服务器控件

Example 1
案例1

The following example is an .aspx page with two labels in a form. Each label has a reference to an internal style. The text in the first label will be displayed in bold and the text in the second label will be displayed in red:
下面这个案例是一个在一张表单内包含两个标签的 .aspx 页面。每个标签都有一个连接到内部样式的参数。第一个标签的文本字体将以粗体形式显示,第二个标签的文本字体将以红色显示:

<%@ Page Inherits="System.Web.UI.MobileControls.MobilePage"%>
<%@ Register TagPrefix="Mobile"
Namespace="System.Web.UI.MobileControls"

Assembly="System.Web.Mobile" %>
<Mobile:StyleSheet runat="server">
<Style name="title" Font-Bold="true" />

<Style name="message" ForeColor="red" />
</Mobile:StyleSheet>
<Mobile:Form id="f1" runat="server">

<Mobile:Label runat="server" Text="Hello W3POP!"
StyleReference="title" />
<Mobile:Label runat="server" Text="This is a nice day!"

StyleReference="message" />
</Mobile:Form>

[] [返回上一页] [打 印]
文章评论

用户名: 查看更多评论

分 值:100分 85分 70分 55分 40分 25分 10分 0分

内 容:

         (注“”为必填内容。) 验证码: 验证码,看不清楚?请点击刷新验证码