首 页WAP教程WAP源码WAP电子书客户留言龙腾电脑维修网158网络电视本站论坛繁體中文
设为首页
加入收藏
联系我们
您当前的位置:WAP开发网 -> WAP教程 -> ASP.net WAP开发教程 -> 文章内容 退出登录 用户管理
栏目导航
· ASP WAP开发教程 · ASP.net WAP开发教程
· PHP WAP开发教程 · WML教程
· JSP开发WAP教程 · WAP 2.0
· 综合杂谈
热门文章
· WAP 2.0教程
· WML语言基础(WAP建站...
· 用VS2005实现ASP.NE...
· [组图] php WAp开发教程
· WML语言基础(WAP建站...
· VS.NET 2003开发移动...
· [图文] ASP技术进行动态WAP...
· [图文] WML语言基础(WAP建站...
· asp.net移动控件开发...
· [图文] 创建移动Web应用程序...
相关文章
· [图文] ASP.NET移动开发之S...
· ASP.NET 2.0移动开发...
· ASP.NET 移动 Web 窗...
· asp.net移动控件开发...
· ASP.NET 2.0移动开发...
· Wap页面使用asp.net...
· ASP.NET 2.0移动开发...
· ASP.NET 2.0移动开发...
· asp.net2.0移动控件...
· asp.net对wap的开发...
StyleSheet 控件没有特定于设备的行为
作者:不详  来源:不详  发布时间:2006-4-10 10:53:01  发布人:tangyunfei

减小字体 增大字体


StyleSheet 控件没有特定于设备的行为。

样式表只确定控件接收的特性的值,不确定设备将对这些特性执行哪些操作。

示例

下面的示例创建一个窗体上具有 Stylesheet 控件的 .aspx 文件,同时在一个名为 Mobile_style.ascx 的外部文件中创建一个用户控件,该文件中包含样式表和模板信息。

StyleSheet 控件是在 .aspx 文件中创建的。

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

<mobile:StyleSheet
   id="Style1"
   ReferencePath="Mobile_style.ascx"
   runat="server">
</mobile:StyleSheet>

<mobile:Form id=WelcomeForm runat="server" StyleReference="Style1"
   title="Welcome" >
   <mobile:Label runat="server" Text=" Welcome " StyleReference="title" />
</mobile:Form>

StyleSheet 定义包含在外部 Mobile_style.aspx 文件中。

//Code in Mobile_style.ascx ( external stylesheet in a user control).
<Mobile:Stylesheet
   runat="server">
   <Style name="Style1">
      <DeviceSpecific>
        <Choice Filter="isHTML32">
         <HeaderTemplate>
            // Add other code or controls here, such as a banner
            // or an AdRotator control.
         </HeaderTemplate>
         <FooterTemplate>
            // Add other code or controls here, such as footers,
            // or a copyright.
         </FooterTemplate>
         </Choice>
      </DeviceSpecific>
   </Style>

   <Style name="Style2">
      <DeviceSpecific>
        <Choice Filter="isWML11">
         <HeaderTemplate>
            // Add other code or controls here.
            // This section would point to WML .wbmp files.
         </HeaderTemplate>
         <FooterTemplate>
            // Add other code or controls here.
            // This section would point to WML .wbmp files.
         </FooterTemplate>
         </Choice>
      </DeviceSpecific>
   </Style>
</Mobile:Stylesheet>

将以下设备筛选器定义添加到您的 web.config 文件中。

<configuration>
   <system.web>
   <deviceFilters>
      <filter name="isHTML32" compare="PreferredRenderingType" argument="html32" />
      <filter name="isWML11" compare="PreferredRenderingType" argument="wml11" />
   </deviceFilters>
   </system.web>
</configuration>
[] [返回上一页] [打 印] [收 藏]
∷相关文章评论∷    (评论内容只代表网友观点,与本站立场无关!) [更多评论...]
关于本站 - 网站帮助 - 广告合作 - 下载声明 - 友情连接 - 网站地图 - 管理登录
Copyright © 2002-2005 wapkf.com. All Rights Reserved .
浙ICP备06013604号|站长QQ:274273595