我尝试通过GridView.css将样式放入Masterpage我的母版页包含3页,3页源也有GridView。我添加了头标记css文件:
< link type =“text / css”href =“../ CSS / GridView.css”rel =“stylesheet”/>
还给我的GridVew源属性:
<asp:GridView ID="gwRehber" runat="server" AutoGenerateColumns="false" CssClass="tablestyle" onrowcommand="gwRehber_RowCommand"> <AlternatingRowStyle CssClass="altrowstyle" /> <HeaderStyle CssClass="headerstyle" /> <RowStyle CssClass="rowstyle" /> <Columns> <asp:TemplateField> <ItemTemplate> <asp:Button runat="server" ID="btnID" CommandName="select" CommandArgument='<%# Eval("ID") %>' Text="Seç" /> </ItemTemplate> </asp:TemplateField> <asp:BoundField DataField="Ad" HeaderText="Ad" Visible="true" /> <asp:BoundField DataField="BireyID" HeaderText="BireyID" Visible="false" /> <asp:BoundField DataField="Degistiren" HeaderText="Değiştiren" Visible="false" /> <asp:BoundField DataField="EklemeTarihi" HeaderText="EklemeTarihi" Visible="true" /> <asp:BoundField DataField="DegistirmeTarihi" HeaderText="Değiştirme Tarihi" Visible="true" /> <asp:BoundField DataField="Ekleyen" HeaderText="Ekleyen" Visible="true" /> <asp:BoundField DataField="ID" HeaderText="ID" Visible="false" /> <asp:BoundField DataField="Imza" HeaderText="Imza" Visible="true" /> <asp:BoundField DataField="KurumID" HeaderText="KurumID" Visible="false" /> </Columns> </asp:GridView>/code>
答案 0 :(得分:1)
图片的路径不正确。它们应该基于CSS文件的位置。将它们更改为../Img/sprite.png,它应该可以正常工作。