这些是问题:
编译错误
说明:在编译服务此请求所需的资源期间发生错误。请查看以下特定错误详细信息并适当修改您的源代码。
编译器错误消息:CS0118:“System.Web.UI.WebControls.SqlDataSource”是“类型”,但用作“变量”
源错误:
第 31 行:
第 32 行:
第 33 行:“runat="server" 第 35 行:DataSourceID="SqlDataSource1"
这是我的代码:
<asp:ListView ID="ListView1" GroupItemCount="3" DataKeyNames="pic_id"
DataSource="<%# SqlDataSource %>" runat="server"
DataSourceID="SqlDataSource1"
onselectedindexchanged="ListView1_SelectedIndexChanged">
<AlternatingItemTemplate>
<td runat="server" style="background-color: #FFFFFF;color: #284775;">
pic_id:
<asp:Label ID="pic_idLabel" runat="server" Text='<%# Eval("pic_id") %>' />
<br />
picture_tag:
<asp:Label ID="picture_tagLabel" runat="server"
Text='<%# Eval("picture_tag") %>' />
<br />
pic:
<asp:Label ID="picLabel" runat="server" Text='<%# Eval("pic") %>' />
<br />
</td>
</AlternatingItemTemplate>
<EmptyDataTemplate>
<table runat="server"
style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;">
<tr>
<td>
No data was returned.</td>
</tr>
</table>
</EmptyDataTemplate>
<InsertItemTemplate>
<td runat="server" style="">
picture_tag:
<asp:TextBox ID="picture_tagTextBox" runat="server"
Text='<%# Bind("picture_tag") %>' />
<br />
pic:
<asp:TextBox ID="picTextBox" runat="server" Text='<%# Bind("pic") %>' />
<br />
<asp:Button ID="InsertButton" runat="server" CommandName="Insert"
Text="Insert" />
<br />
<asp:Button ID="CancelButton" runat="server" CommandName="Cancel"
Text="Clear" />
<br />
</td>
</InsertItemTemplate>
<LayoutTemplate>
<table runat="server">
<tr runat="server">
<td runat="server">
<table ID="groupPlaceholderContainer" runat="server" border="1"
style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;font-family: Verdana, Arial, Helvetica, sans-serif;">
<tr ID="groupPlaceholder" runat="server">
</tr>
</table>
</td>
</tr>
<tr runat="server">
<td runat="server"
style="text-align: center;background-color: #5D7B9D;font-family: Verdana, Arial, Helvetica, sans-serif;color: #FFFFFF">
<asp:DataPager ID="DataPager1" runat="server" PageSize="12">
<Fields>
<asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True"
ShowLastPageButton="True" />
</Fields>
</asp:DataPager>
</td>
</tr>
</table>
</LayoutTemplate>
<EditItemTemplate>
<td runat="server" style="background-color: #999999;">
pic_id:
<asp:Label ID="pic_idLabel1" runat="server" Text='<%# Eval("pic_id") %>' />
<br />
picture_tag:
<asp:TextBox ID="picture_tagTextBox" runat="server"
Text='<%# Bind("picture_tag") %>' />
<br />
pic:
<asp:TextBox ID="picTextBox" runat="server" Text='<%# Bind("pic") %>' />
<br />
<asp:Button ID="UpdateButton" runat="server" CommandName="Update"
Text="Update" />
<br />
<asp:Button ID="CancelButton" runat="server" CommandName="Cancel"
Text="Cancel" />
<br />
</td>
</EditItemTemplate>
<GroupTemplate>
<tr ID="itemPlaceholderContainer" runat="server">
<td ID="itemPlaceholder" runat="server">
</td>
</tr>
</GroupTemplate>
<EmptyItemTemplate>
<td runat="server" />
</EmptyItemTemplate>
<ItemTemplate>
<td runat="server" style="background-color: #E0FFFF;color: #333333;">
pic_id:
<asp:Label ID="pic_idLabel" runat="server" Text='<%# Eval("pic_id") %>' />
<br />
picture_tag:
<asp:Label ID="picture_tagLabel" runat="server"
Text='<%# Eval("picture_tag") %>' />
<br />
pic:
<asp:Label ID="picLabel" runat="server" Text='<%# Eval("pic") %>' />
<br />
</td>
</ItemTemplate>
<SelectedItemTemplate>
<td runat="server"
style="background-color: #E2DED6;font-weight: bold;color: #333333;">
pic_id:
<asp:Label ID="pic_idLabel" runat="server" Text='<%# Eval("pic_id") %>' />
<br />
picture_tag:
<asp:Label ID="picture_tagLabel" runat="server"
Text='<%# Eval("picture_tag") %>' />
<br />
pic:
<asp:Label ID="picLabel" runat="server" Text='<%# Eval("pic") %>' />
<br />
</td>
</SelectedItemTemplate>
</asp:ListView>