Поиск:

Ответ в темуСоздание новой темы Создание опроса
> ите применить ситль css к GridView 
:(
    Опции темы
Napalmx
Дата 31.3.2013, 18:33 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Новичок



Профиль
Группа: Участник
Сообщений: 15
Регистрация: 15.9.2009

Репутация: нет
Всего: нет



Новичок в ASP.NET. Кинул на форму GridView связал с данными, но стили оформления не отображаются. Все действие разворачивается в ContentPlaceHolder1
Код masterpage:
Код

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

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>12312321</title>
    <asp:ContentPlaceHolder id="head" runat="server">
    </asp:ContentPlaceHolder>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <link href="default.css" rel="stylesheet" type="text/css" />
    </head>
<body>
<div id="outer">
    <div id="header">
        <h1><a href="#">GenericBlue</a></h1>
        <h2>by Free CSS Templates</h2>
    </div>
    <div id="menu">
        <ul>
            <li class="first"><a href="#" accesskey="1" title="">Home</a></li>
            <li><a href="#" accesskey="2" title="">About Us</a></li>
            <li><a href="#" accesskey="3" title="">Products</a></li>
            <li><a href="#" accesskey="4" title="">Services</a></li>
            <li><a href="#" accesskey="5" title="">Contact Us</a></li>
        </ul>
    </div>
    <div id="content">
        <div id="tertiaryContent">
            <h3>Lorem ipsum dolor</h3>
            <div class="xbg"></div>
        </div>
        <div id="primaryContentContainer">
            <div id="primaryContent">
                 <form id="form1" runat="server">
                 <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
                 </asp:ContentPlaceHolder>
                </form>
                <h3>Example Table</h3>
                <table>
                    <tr class="rowH">
                        <th>Date</th>
                        <th>Title</th>
                        <th>Description</th>
                    </tr>
                    <tr class="rowA">
                        <td>December 1, 2006</td>
                        <td>Sed vestibulum blandit</td>
                        <td>Vivamus sollicitudin dolor sit amet eros. Vivamus ligula. Sed pretium turpis eu ipsum. Sed rutrum sapien id arcu.</td>
                    </tr>
                    <tr class="rowB">
                        <td>November 28, 2006</td>
                        <td>Augue non nibh</td>
                        <td>Nam adipiscing urna ac consequat dignissim massa est sodales sem.</td>
                    </tr>
                    <tr class="rowA">
                        <td>November 23, 2006</td>
                        <td>Fusce ut diam bibendum</td>
                        <td>Vestibulum quis urn nulla facilis nam malesuada cursus turpis.</td>
                    </tr>
                    <tr class="rowB">
                        <td>November 21, 2006</td>
                        <td>Maecenas et ipsum</td>
                        <td>Vivamus mi lectus gravida scelerisque, ultrices vitae cursus in neque.</td>
                    </tr>
                </table>
            </div>
        </div>
        <div id="secondaryContent">
            <h3>Etiam suscipit et</h3>
            <div class="xbg"></div>
        </div>
        <div class="clear"></div>
    </div>
    <div id="footer">
        <p>Copyright &copy; 2006 Sitename.com. Designed by <a href="http://www.freecsstemplates.org">Free CSS Templates</a></p>
    </div>
</div>
</body>
</html>




Код страницы с гридом:

Код


<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Prikreplennoe.aspx.cs" Inherits="Default2" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <h2>Статистика</h2>
         <asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1" Width="100%" AllowPaging="True">
             <HeaderStyle CssClass="RowH" />
             <RowStyle CssClass="RowB" />
        </asp:GridView>
       <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand="select * from Table_1"></asp:SqlDataSource>
</asp:Content>


default.css:

Код

/*
    Design by Free CSS Templates
    http://www.freecsstemplates.org
    Released for free under a Creative Commons Attribution 2.5 License
*/

/* Basic */

*
{
    margin: 0em;
    padding: 0em;
}

h1,h2
{
}

body
{
    font-family: Arial, sans-serif;
    font-size: 10pt;
    color: #666;
    background-color: #fff;
}

a
{
    color: #0077dd;
    text-decoration: underline;
}

a:hover
{
    text-decoration: none;
}

/* Outer */

#outer
{
    padding: 0em;
    margin: 0em;
    width: 100%;
}

/* Header */

#header
{
    position: relative;
    background: #004778 url('images/a5.gif') bottom left repeat-x;
    height: 10em;
    padding-left: 2em;
}

#header h1
{
    position: absolute;
    top: 1.8em;
    font-size: 2.2em;
    letter-spacing: -0.05em;
}

#header h1 a
{
    color: #fff;
    text-decoration: none;
}

#header h2
{
    position: absolute;
    font-size: 0.8em;
    top: 8em;
    color: #E0E8EF;
}

/* Menu */

#menu
{
    position: absolute;
    top: 5em;
    right: 3em;
}

#menu ul
{
    list-style: none;
}

#menu li
{
    display: inline;
    padding-left: 1.1em;
    margin-left: 1em;
    border-left: dotted 1px #E0E8EF;
}

#menu li.first
{
    border: 0em;
    margin-left: 0em;
    padding-left: 0em;
}

#menu li a
{
    color: #fff;
    padding: 0.1em;
    text-decoration: none;
}

#menu li a:hover
{
    text-decoration: underline;
}

/* Content */

#content
{
    line-height: 1.5em;
}


#content p
{
    margin-bottom: 1.5em;
}

#content h2,h3,h4,h5,h6
{
    color: #545454;
    margin-bottom: 1em;
    border-bottom: dashed 1px #dfdfdf;
    padding-bottom: 0.3em;
}

#content h2
{
    font-size: 1.5em;
}

#content h3
{
    font-size: 1.1em;
}

#content ul
{
    margin-bottom: 1.5em;
    padding-left: 1em;
    list-style: square;
}

#content blockquote
{
    margin-bottom: 1.5em;
    padding: 0.75em 0.75em 0.75em 1.5em;
    border-left: solid 0.75em #005082;
    background: #FDFDFD url('images/a7.gif') top left repeat-x;
}

#content blockquote p
{
    margin-bottom: 0em;
}

#content table
{
    margin-bottom: 1.5em;
    border-collapse: collapse;
    text-align: left;
}

#content table th
{
    font-weight: bold;
    padding: 0.5em;
}

#content table td
{
    padding: 0.5em;
    border-right: solid 1px #fff;
}

#content table tr.rowH
{
    color: #fff;
    background: #006192 url('images/a8.gif') top left repeat-x;
    border-right: solid 1px #fff;
}

#content table tr.rowA
{
    background: #F8F8F8 url('images/a6.gif') top left repeat-x;
    border-top: solid 1px #fff;
    color: inherit;
}

#content table tr.rowB
{
    background: #FDFDFD url('images/a7.gif') top left repeat-x;
    border-top: solid 1px #fff;
    color: inherit;
}

/* Primary Content */

#primaryContentContainer
{
    background-color: #fff;
    float: right;
    margin: 0em -19em 0em -19em;
    width: 100%;
}

#primaryContent
{
    margin: 1.5em 19em 0em 17.25em;
    padding: 1.5em 3em 1.5em 3em;
}

/* Secondary Content */

#secondaryContent
{
    position: relative;
    float: left;
    width: 14em;
    padding: 3em 2em 1.5em 2em;
    background: #fff url('images/a1.gif') top right repeat-y;
}

#secondaryContent .xbg
{
    position: absolute;
    right: 0em;
    bottom: -64px;
    background: #fff url('images/a3.gif') top right no-repeat;
    height: 64px;
    width: 128px;
}

/* Tertiary Content */

#tertiaryContent
{
    position: relative;
    float: right;
    width: 15em;
    padding: 3em 2em 1.5em 2em;
    background: #fff url('images/a2.gif') top left repeat-y;
}

#tertiaryContent .xbg
{
    position: absolute;
    left: 0em;
    bottom: -64px;
    background: #fff url('images/a4.gif') top left no-repeat;
    height: 64px;
    width: 128px;
}

/* Footer */

#footer
{
    position: relative;
    z-index: 1;
    border-top: dashed 1px #dfdfdf;
    padding: 1em 0em 2em 0em;
    margin: 1em 2em 0em 2em;
    text-align: center;
}



а вот результат в html:
Код





<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>
    12312321
</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" /><meta name="keywords" /><meta name="description" /><link href="default.css" rel="stylesheet" type="text/css" /></head>
<body>
<div id="outer">
    <div id="header">
        <h1><a href="#">GenericBlue</a></h1>
        <h2>by Free CSS Templates</h2>
    </div>
    <div id="menu">
        <ul>
            <li class="first"><a href="#" accesskey="1" title="">Home</a></li>
            <li><a href="#" accesskey="2" title="">About Us</a></li>
            <li><a href="#" accesskey="3" title="">Products</a></li>
            <li><a href="#" accesskey="4" title="">Services</a></li>
            <li><a href="#" accesskey="5" title="">Contact Us</a></li>
        </ul>
    </div>
    <div id="content">
        <div id="tertiaryContent">
            <h3>Lorem ipsum dolor</h3>
            <div class="xbg"></div>
        </div>
        <div id="primaryContentContainer">
            <div id="primaryContent">
                 <form method="post" action="Prikreplennoe.aspx" id="form1">
<div class="aspNetHidden">
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="kQE+r1gGnD3Php4/0aeiPtsQlYBYMlCn/OwxsqUoyCjWMj/EU8k4/ZA6adWvKIPJBISdP8Ge5tMgwy/SwXFylJPMSTqZ77QwoduCFR8ItqMmldnzh7lJ3XBEfRKSG78nmXpL4Af7azGpROjp1ToSHBsLmQA9wTRNTYRxv4DDsB8wkXF7BVUC0if/Ng7qyfeh04WI/QJUcGgSEthWehqiJnsfX7a6F0SqoQTXxP9GnEoKtPT9A5HSCjq/1G5cIcEHLlLJMqEH7jLZ93GTHdSThArW2Oi/TG5z2iXMaZAYTsUh0ht/2jwEmG6OmigueQ0y012B7Fse78q2yBECOepE9VoQsKQrZCJ28mJOUqqNUfOe00I8fND7EFAlgTUiJMdpQiJQKIwd+Xzqj6XXXbLuJM02+FcjpifDq5gQl0T/iLM1n4d1G/M0Cnh3foDhsqRRg5iLEQCAzTkK97fCc3nls9xMiKpcqQTTJNNoAryIakU3M8ECfuNOjMWeEdhGmgw2S8sQ483DOR397ysTTPmrhVtIgiiHePwa50RQZn1+qJlEnb2UIAlIeOCPlXdKl+oUr1u9lw2W5oPgjvN38sFtN5HZ0c+LEK3hGGudNoFJoqinZbPvnngfHjmxAdM8TdAp6SqI+Ao2Z3NBjiXavdAml1Ym0B/xliVfLSDMYR6fOoXDqwuXCRgNpI6o79vsTuihn66Rf7KwoZQpg3bvfO3OPIonZaEP54wCzzqGTg5zrCoNkIrhsE0TRv2BwoA9KbfkO/HlAbkLOUfy4rgdsNEy7AB1avwGKVk8JQilgnapJ1S8M92/dSzWeAeoTdiRrCJN2Xiq0jF7o1qSaLDuSJfCR9/9o8KMn6gQuXcm7I+eCKfVtoZDAY+UOnHlrYr44rm4Oj7fvL2AQC3hCCjTwjMsWtlM0pvio6PpLooyIlaUA8lFb8txU6WADWVzilDPxYU9BLMS8WJCZvR4/jkpoi9iDLgbk+iA/IXHDnunLe0ZrlJpb4JeWRoJyNvoA2ufPhExdocV+6tOLERUZa+k1wp5xpMpqywKNy2em4Od6rKdUeMnma2av48lAxp6aAwUyWqN+fyWm6Ps2wc7BDpga6WrQkPLMyckSy9pmsJ16EFjV01UUwoq5m5WfoiaY/NlTCUW0AQ+yTykNoh5A4K6ZQy9lwT9Gk+7Sh8cJ1CMzzKr3Rs38eJSnzlq7GLyIN5bDdqJtfD2CKXGHKypnStYVMIkJTJDrkTHATor1y4ASXPpLU/PLX2d/0TIcSDHRSodIGWV" />
</div>

<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
    theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]>
</script>


<div class="aspNetHidden">

    <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="+RyUPX0zLVN/U1F7OJMHXz0O3kZN0jVJfNZmTSYg0O/ZHE4gmgCWZ9gMBtT+QY0+miY+CTrTfaWX7stsBgswmOk/dNDq1O0BFvIG0JH8OSRNkyxQgbqmawZosp8p1haC+VD3tL1Sy/r8eKdewt/mGU/eVNEVRkoxeyhkVoLAaSoHdiuHyFoh8iEt7OjyzsZq" />
</div>
                 
    <h2>Статистика</h2>
         <div>
    <table cellspacing="0" rules="all" border="1" id="ContentPlaceHolder1_GridView1" style="width:100%;border-collapse:collapse;">
        <tr class="RowH">
            <th scope="col">x</th><th scope="col">y</th>
        </tr><tr class="RowB">
            <td>the It process # they additional of thin col</td><td>180</td>
        </tr><tr class="RowB">
            <td>mass planetesimals collapse surrounded are their</td><td>142</td>
        </tr><tr class="RowB">
            <td>certainty forms mass larger</td><td>90</td>
        </tr><tr class="RowB">
            <td>to of rotating</td><td>159</td>
        </tr><tr class="RowB">
            <td>formed are are increasing</td><td>3</td>
        </tr><tr class="RowB">
            <td>moon, increasing greatly ever the gravitational</td><td>31</td>
        </tr><tr class="RowB">
            <td>accelerate with concentrations gas</td><td>189</td>
        </tr><tr class="RowB">
            <td>during dust concentrations reaches increasing di</td><td>38</td>
        </tr><tr class="RowB">
            <td>Earth's of is nebula accretion</td><td>64</td>
        </tr><tr class="RowB">
            <td>the accretion dust. at is greatly mass</td><td>158</td>
        </tr><tr>
            <td colspan="2"><table>
                <tr>
                    <td><span>1</span></td><td><a href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView1','Page$2')">2</a></td><td><a href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView1','Page$3')">3</a></td><td><a href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView1','Page$4')">4</a></td><td><a href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView1','Page$5')">5</a></td>
                </tr>
            </table></td>
        </tr>
    </table>
</div>
       

                </form>
                <h3>Example Table</h3>
                <table>
                    <tr class="rowH">
                        <th>Date</th>
                        <th>Title</th>
                        <th>Description</th>
                    </tr>
                    <tr class="rowA">
                        <td>December 1, 2006</td>
                        <td>Sed vestibulum blandit</td>
                        <td>Vivamus sollicitudin dolor sit amet eros. Vivamus ligula. Sed pretium turpis eu ipsum. Sed rutrum sapien id arcu.</td>
                    </tr>
                    <tr class="rowB">
                        <td>November 28, 2006</td>
                        <td>Augue non nibh</td>
                        <td>Nam adipiscing urna ac consequat dignissim massa est sodales sem.</td>
                    </tr>
                    <tr class="rowA">
                        <td>November 23, 2006</td>
                        <td>Fusce ut diam bibendum</td>
                        <td>Vestibulum quis urn nulla facilis nam malesuada cursus turpis.</td>
                    </tr>
                    <tr class="rowB">
                        <td>November 21, 2006</td>
                        <td>Maecenas et ipsum</td>
                        <td>Vivamus mi lectus gravida scelerisque, ultrices vitae cursus in neque.</td>
                    </tr>
                </table>
            </div>
        </div>
        <div id="secondaryContent">
            <h3>Etiam suscipit et</h3>
            <div class="xbg"></div>
        </div>
        <div class="clear"></div>
    </div>
    <div id="footer">
        <p>Copyright &copy; 2006 Sitename.com. Designed by <a href="http://www.freecsstemplates.org">Free CSS Templates</a></p>
    </div>
</div>
</body>
</html>




В итоге стили не отображены. Пните в нужную  сторону плиз.
PM MAIL   Вверх
Google
  Дата 10.12.2019, 05:47 (ссылка)  





  Вверх
  
Ответ в темуСоздание новой темы Создание опроса
1 Пользователей читают эту тему (1 Гостей и 0 Скрытых Пользователей)
0 Пользователей:
« Предыдущая тема | ASP | Следующая тема »


 




[ Время генерации скрипта: 0.0760 ]   [ Использовано запросов: 20 ]   [ GZIP включён ]


Реклама на сайте     Информационное спонсорство

 
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности     Powered by Invision Power Board(R) 1.3 © 2003  IPS, Inc.