Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/273.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 为什么不是';是否正在应用我的GridView CSSClass?_C#_Css_Asp.net_Gridview - Fatal编程技术网

C# 为什么不是';是否正在应用我的GridView CSSClass?

C# 为什么不是';是否正在应用我的GridView CSSClass?,c#,css,asp.net,gridview,C#,Css,Asp.net,Gridview,我正在尝试在ASP.net中设置一个新网页。我正在使用带有分页的gridview,但是我尝试使用的CSS类没有得到应用。页面其余部分的CSS正在工作,它只是与这个gridview相关。我一直无法通过谷歌找到答案。请帮忙,谢谢你的帮助 我尝试过在不同的类之间更改CSS类,我尝试过更改CSS类,我尝试过从站点主控中删除CSS链接,我尝试过从Gridview中删除DIV容器,但这些都没有起到任何作用 Gridview: <%--Records of the graphed data --%>

我正在尝试在ASP.net中设置一个新网页。我正在使用带有分页的gridview,但是我尝试使用的CSS类没有得到应用。页面其余部分的CSS正在工作,它只是与这个gridview相关。我一直无法通过谷歌找到答案。请帮忙,谢谢你的帮助

我尝试过在不同的类之间更改CSS类,我尝试过更改CSS类,我尝试过从站点主控中删除CSS链接,我尝试过从Gridview中删除DIV容器,但这些都没有起到任何作用

Gridview:

<%--Records of the graphed data --%>
    <div class="Records">
<h4>Shutdown Records</h4>
        <asp:GridView ID="datagrid" runat="server" DataSourceID="SqlDataSource6" CssClass="mGrid" PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt" 
           PageSize="6" AllowPaging="True" OnPageIndexChanging="datagrid_PageIndexChanging" Width="100%">
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource6" runat="server" 
        ConnectionString="<%$ ConnectionStrings:Automation %>"
        ProviderName="System.Data.SqlClient" SelectCommand="select ShutdownDate, ShutdownNotes, StartupDate, StartupNotes, Cast
(
    Round 
    (
        (
        Cast
            (
            SUM(TotalDownTime)as decimal(18, 2)
            )/3600
        )
    , 2 
    ) as decimal(18, 2) 
) as 'Duration of Shutdowns (Hours)' 
from ProductionShutdownRecord 
where Reason like '%'+@Reason+'%'
and ShutdownNotes like '%'+@shutdownNotes+'%'
and StartupNotes like '%'+@startupNotes+'%'
and ShutdownDate &gt;= @startDate
and ShutdownDate &lt;= @endDate
and AMSTaskRelated like 
    CASE 
        when @AMS = 1 then '%1%'
        else '%%'
    END
group by ShutdownDate, ShutdownNotes, StartupDate, StartupNotes
order by shutdowndate asc
">
                <SelectParameters>
                <asp:ControlParameter ControlID="DropDownList1" DefaultValue="Scheduled Release" 
                    Name="Reason" PropertyName="SelectedValue" Type="String" />
                <asp:ControlParameter ControlID="shutdownNotes" ConvertEmptyStringToNull="False" 
                    Name="shutdownNotes" PropertyName="Text" Type="String" />
                <asp:ControlParameter ControlID="startupNotes" ConvertEmptyStringToNull="False" 
                    Name="startupNotes" PropertyName="Text" Type="String" />
                <asp:ControlParameter ControlID="startDate" ConvertEmptyStringToNull="False" 
                    Name="startDate" PropertyName="Text" Type="String" />
                <asp:ControlParameter ControlID="endDate" ConvertEmptyStringToNull="False" 
                    Name="endDate" PropertyName="Text" Type="String" />
                <asp:ControlParameter ControlID="AMSCheck"
                    Name="AMS" PropertyName="Checked"/>
                </SelectParameters>
</asp:SqlDataSource>
</div>
预期结果:我正在尝试使用此CSS模板:

实际结果:
我得到了一个纯白色的网格视图。

为了子孙后代的利益,为了让这个问题有一个答案,我将在这里写出解决方案

使用键盘快捷键
Ctrl
+
Shift
+
R
清除浏览器的缓存。现代浏览器缓存javascript和css文件等资源,以便下次访问时加载速度更快。如果您对CSS进行了更改,但它们没有出现,则很可能您的浏览器仍在使用缓存版本


如果您担心用户看到的是缓存的资源而不是更新的资源,请查看这些资源以帮助防止这些问题。

您能否向我们提供生成的HTML?另外,如果您还没有清除缓存,我会尝试的第一件事就是清除缓存(在大多数主流浏览器中,按
Ctrl
+
Shift
+
R
)哇,清除缓存成功了!但为什么会这样呢?你能解释一下吗?当然!因此,现代浏览器缓存javascript和css文件等资源,以便下次访问时加载速度更快。如果您对CSS进行了更改,但它们没有出现,则很可能您的浏览器仍在使用缓存版本。按
Ctrl
+
Shift
+
R
清除那些缓存对象并强制浏览器获取新副本!你是救命恩人,非常感谢!很乐意帮忙!查看诸如或如何使用开发人员工具禁用浏览器缓存之类的内容,以使您的生活更轻松
/* Gridview Style
-------------------------------------------------------------------------------------------------------------*/
.mGrid {
    width: 100%;
    background-color: #fff;
    margin: 5px 0 10px 0;
    border: solid 1px #525252;
    border-collapse: collapse;
}

    .mGrid td {
        padding: 2px;
        border: solid 1px #c1c1c1;
        color: #717171;
    }

    .mGrid th {
        padding: 4px 2px;
        color: #fff;
        background: #424242 url(grd_head.png) repeat-x top;
        border-left: solid 1px #525252;
        font-size: 0.9em;
    }

    .mGrid .alt {
        background: #fcfcfc url(grd_alt.png) repeat-x top;
    }

    .mGrid .pgr {
        background: #424242 url(grd_pgr.png) repeat-x top;
    }

        .mGrid .pgr table {
            margin: 5px 0;
        }

        .mGrid .pgr td {
            border-width: 0;
            padding: 0 6px;
            border-left: solid 1px #666;
            font-weight: bold;
            color: #fff;
            line-height: 12px;
        }

        .mGrid .pgr a {
            color: #666;
            text-decoration: none;
        }

            .mGrid .pgr a:hover {
                color: #000;
                text-decoration: none;
            }