zoukankan      html  css  js  c++  java
  • stylesheettheme 与 theme 的区别(转载)

    原文出處:http://www.cnblogs.com/china-liuyang/articles/1050162.html

    stylesheettheme 与 theme 的区别

    首先们建立一个外观文件.名为 text.skin 然后在里面写入.

    text.skin
    <asp:TextBox runat="server" width="80px" /> //设置 TextBox 的宽度为 80px

    <asp:button runat="server" width="60px" /> //设置 Button 的宽度为 60px

    然后在 hello.aspx 页面引入外观文件.我们用 stylesheettheme 来引入

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="hello.aspx.cs" Inherits="hello" StylesheetTheme="text.skin" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>测试</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:TextBox ID="txtTest" runat="server" Width="100px"></asp:TextBox> <!-- 把txtTest的长度固定为100px -->
            <asp:TextBox ID="txtTest1" runat="server"></asp:TextBox> <!-- 不给txtTest1设置长度 -->
            <asp:Button ID="btnTest" runat="server" Text="Button" /><!-- 不给btnTest设置长度 -->
            </asp:DropDownList>
        </div>
        </form>
    </body>
    </html>

     

          这样显示页面效果为: txtTest的最终宽度为 100px;  txtTest1 的长度为 80px; btnTest:的长度为 60px; 这就说明,在页面对控件进行固定大小设置,然后用 StylesheetTheme 属性进行引用外观文件.是不会改变控件自身的固定大小.

         如果引用外观文件属性换为 Theme ,那么页面所有的 TextBox 的宽度都将为 80px;(不管是否有固定大小) 同理所有Button控件的宽度都将为 60px;

  • 相关阅读:
    “百度杯”CTF比赛 九月场 code
    初识thinkphp(3)
    i春秋CTF web题(1)
    初识thinkphp(2)
    初识thinkphp(1)
    0MQ底层队列设计
    0MQ文档导读
    LF模式是个坑,ZeroIce中间件让你体会这个痛
    0xe7f001f0!?NDK调试过程,无故抛出SIGSEGV。
    KDevelop
  • 原文地址:https://www.cnblogs.com/purplefox2008/p/1359705.html
Copyright © 2011-2022 走看看