Я использую шаблон заголовка для отображения изображения, и я установил значение высоты и ширины равным 100 и 100 в стиле заголовка, но изображение, отображаемое на полной странице позже, я применяю значение ширины высоты к изображению, теперь размер изображения в порядке, нополя слева показаны, почему так?Вот код:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Scraps_page.aspx.cs" Inherits="Scraps_page" %>
<!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>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<tr>
<td>
<asp:DetailsView ID="DetailsView1" runat="server" Height="50px" Width="125px"
AutoGenerateRows="False" DataSourceID="SqlDataSource1">
<HeaderStyle BackColor="Bisque" Height="100" Width="100" />
<HeaderTemplate>
<asp:Image ID="Image1" Height="100" Width="100" runat="server" ImageUrl='<%#Eval("ImageUrl") %>' AlternateText='<%#Eval("ImageUrl") %>' />
</HeaderTemplate>
<FooterTemplate>
<asp:Literal ID="Literal1" runat="server" Text='<%#Eval("Name") %>'></asp:Literal>
</FooterTemplate>
</asp:DetailsView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ex %>"
SelectCommand="SELECT * FROM [tblImage] WHERE ([id] = @id)">
<SelectParameters>
<asp:QueryStringParameter Name="id" QueryStringField="id" Type="Decimal" />
</SelectParameters>
</asp:SqlDataSource>
</td>
<td></td>
</tr>
</table>
</div>
</form>
</body>
</html>