首页 新闻 论坛 群组 Blog 文档 下载 读书 Tag 网摘 搜索 .NET Java 游戏 视频 人才 外包 培训 数据库 书店 程序员
中国软件网
欢迎您:游客 | 登录 注册 帮助
  • form验证,css文件为什么和master page一起不好用 [已结贴,结贴人:xiaoyuzi]
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    • xiaoyuzi
    • 等级:
    • 可用分等级:
    • 总技术分:
    • 总技术分排名:
    • 揭贴率:
    发表于:2008-04-24 13:34:07 楼主
    default.aspx 和 login.aspx都共用一个魔板页,没有登陆就会进入login.aspx,发现Style.css都没有效果,但是登陆后跳转到default.aspx,default.aspx上效果是好用的,下面是魔板和css文件内容

    Site.master
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    <%@ Master Language="C#" AutoEventWireup="true" CodeFile="Site.master.cs" Inherits="Site" %>

    <!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 id="Head1" runat="server">
        <title>Forms Authentication, Authorization, and User Accounts </title>
        <link href="Styles.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
        <div id="wrapper">

            <form id="form1" runat="server">
           
                <div id="header">
                    <span class="title">User Account Tutorials </span> <br />
                </div>
           
                <div id="content">
                    <asp:contentplaceholder id="MainContent" runat="server">
                      <!-- Page-specific content will go here... -->
                    </asp:contentplaceholder>
                </div>
               
                <div id="navigation">
                    <asp:ContentPlaceHolder ID="LoginContent" runat="server">
                        <asp:LoginView ID="LoginView1" runat="server">
                            <LoggedInTemplate>
                                Welcome back,
                                <asp:LoginName ID="LoginName1" runat="server" />.
                            </LoggedInTemplate>
                            <AnonymousTemplate>
                                Hello, stranger.
                            </AnonymousTemplate>
                        </asp:LoginView>
                        <br />
                        <asp:LoginStatus ID="LoginStatus1" runat="server" LogoutAction="Redirect" LogoutPageUrl="~/Logout.aspx" />
                       
                        <br /> <br />
                    </asp:ContentPlaceHolder>
                 
                    TODO: Menu will go here...
                </div>
            </form>
        </div>
    </body>
    </html>
    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    Style.css
    -----------------------------
    /*
      The below CSS file was built using samples + techniques described by Rachel Andrew in her book:
      The CSS Anthology: 101 Essential Tips, Tricks & Hacks
    */

    /* Overall Page */

    body {
    margin: 0;
    padding-bottom: 2em;
    background-color: #FFFFFF;
    color: #000000;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    border-top: 2px solid #B51032;
    }

    /* Header Section */

    #header {
    border-top: 3px solid #B51032;
    border-bottom: 1px dotted #B51032;
    height: 3em;
    }
    #header .title {
    font: 190% Arial, Helvetica, Georgia, "Times New Roman", Times, serif;
    color: black;
    background-color: transparent;
    float: left;
    margin-right: 2em;
    margin-top: 0.3em;
    margin-left: .8em;
    }

    #header a:link, a:visited  {
    color: #B51032;
    }

    /* Navigation */

    #navigation {
    width: 200px;
    top: 5em;
    left: 1em;
    width: 13em;
    position:absolute;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size:90%;
    }
    #navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    }
    #navigation li {
    border-bottom: 1px solid #ED9F9F;
    }
    #navigation li a  {
    display: block;
    padding: 5px 5px 5px 0.5em;
    border-left: 12px solid #711515;
    border-right: 1px solid #711515;
    background-color: #B51032;
    color: #FFFFFF;
    text-decoration: none;
    }
    #navigation li a:hover {
    background-color: #711515;
    color: #FFFFFF;
    }
    #navigation ul ul {
    margin-left: 12px;
    }
    #navigation ul ul li {
    border-bottom: 1px solid #711515;
    margin:0;
    background-color: #ED9F9F;
    color: #711515;
    }
    #navigation ul ul a:link, #navigation ul ul a:visited {
    background-color: #ED9F9F;
    color: #711515;
    }
    #navigation ul ul a:hover {
    background-color: #711515;
    color: #FFFFFF;
    }
    #header .breadcrumb {
    font: 90% Arial, Helvetica, Georgia, "Times New Roman", Times, serif;
    color: black;
    background-color: transparent;
    float: right;
    margin-right: 2em;
    margin-top: 0.8em;
    font-weight:bold;
    }


    /* Main Content */

    #content
    {
    margin-top:1em;
    margin-left: 16em;
    margin-right: 2em;
    }
    h1 {
    font: 150% Arial, Helvetica, Georgia, "Times New Roman", Times, serif;
    }
    #content p {
    font-size: 80%;
    line-height: 1.6em;
    }

    #content ul {
    font-size: 80%;
    line-height: 1.6em;
    }
    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    100  修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    • iuhxq
    • 等级:
    • 可用分等级:
    • 总技术分:
    • 总技术分排名:
    发表于:2008-04-24 13:35:491楼 得分:30
    <link href="Styles.css" rel="stylesheet" type="text/css" />


    <link href="/style/Styles.css" rel="stylesheet" type="text/css" />


    所有类似的资源引用都要用/开头。
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    • underwater
    • 等级:
    • 可用分等级:
    • 总技术分:
    • 总技术分排名:
    发表于:2008-04-24 13:36:152楼 得分:70
    CSS所在目录被禁止了匿名访问
    这等于自己抽了自己嘴

    还不明白吗?
    修改 删除 举报 引用 回复

    网站简介广告服务网站地图帮助联系方式诚聘英才English 问题报告
    北京创新乐知广告有限公司 版权所有 京 ICP 证 070598 号
    世纪乐知(北京)网络技术有限公司 提供技术支持
    Copyright © 2000-2008, CSDN.NET, All Rights Reserved