我对此并不陌生,所以我想知道是否有人可以帮助我。我不完全确定问题是什么,也不知道如何解决。我该怎么办?
错误消息:
'ASP.modifyinfo_aspx'不包含以下定义 'GridView1_SelectedIndexChanged',并且没有扩展方法 'GridView1_SelectedIndexChanged'接受类型的第一个参数 可以找到“ ASP.modifyinfo_aspx”(您是否缺少使用 指令还是程序集引用?)
我的代码:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Modifyinfo.aspx.cs"
Inherits="Modifyinfo" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
<asp:GridView ID="Modify" runat="server" AutoGenerateColumns="False"
ShowFooter="true" DataKeyNames="ID" BackColor="White"
BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3"
DataSourceID="SqlDataSource1"
OnSelectedIndexChanged="GridView1_SelectedIndexChanged">
<Columns>
<asp:BoundField DataField="Id" HeaderText="Id"
SortExpression="Id" />
<asp:BoundField DataField="UserName" HeaderText="UserName"
SortExpression="UserName" />
<asp:BoundField DataField="FirstName" HeaderText="FirstName"
SortExpression="FirstName" />
<asp:BoundField DataField="SurName" HeaderText="SurName"
SortExpression="SurName" />
<asp:BoundField DataField="DateOfBirth" HeaderText="DateOfBirth"
SortExpression="DateOfBirth" />
<asp:BoundField DataField="Course" HeaderText="Course"
SortExpression="Course" />
<asp:BoundField DataField="TimeofUpdate"
HeaderText="TimeofUpdate" SortExpression="TimeofUpdate" />
<asp:BoundField DataField="CurrentLocation"
HeaderText="CurrentLocation" SortExpression="CurrentLocation" />
</Columns>
<FooterStyle BackColor="White" ForeColor="#000066" />
<HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White"
/>
<PagerStyle BackColor="White" ForeColor="#000066"
HorizontalAlign="Left" />
<RowStyle ForeColor="#000066" />
<SelectedRowStyle BackColor="#669999" Font-Bold="True"
ForeColor="White" />
<SortedAscendingCellStyle BackColor="#F1F1F1" />
<SortedAscendingHeaderStyle BackColor="#007DBB" />
<SortedDescendingCellStyle BackColor="#CAC9C9" />
<SortedDescendingHeaderStyle BackColor="#00547E" />
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:ImageButton ImageUrl="~/images/edit.png" runat="server"
CommandName="Edit" tooltip="Edit" Width="20px" Height="20px"/>
<asp:ImageButton ImageUrl="~/images/delete.png"
runat="server" CommandName="Delete" tooltip="Delete" Width="20px"
Height="20px"/>
</ItemTemplate>
<EditItemTemplate>
<asp:ImageButton ImageUrl="~/images/save.png" runat="server"
CommandName="Update" tooltip="Update" Width="20px" Height="20px"/>
<asp:ImageButton ImageUrl="~/images/cancel.png"
runat="server" CommandName="Cancel" tooltip="Cancel" Width="20px"
Height="20px"/>
</EditItemTemplate>
<FooterTemplate>
<asp:ImageButton ImageUrl="~/images/addnew.png"
runat="server" CommandName="AddNew" tooltip="AddNew" Width="20px"
Height="20px"/>
</FooterTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<br />
<asp:Label ID="lblSuccessMessage" Text="" runat="server"
ForeColor="Green" />
<br />
<asp:Label ID="lblErrorMessage" Text="" runat="server" ForeColor="Red"
/>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="
<%$ ConnectionStrings:rde_529455ConnectionString %>" SelectCommand="SELECT
* FROM [STUDENTSIDE]"></asp:SqlDataSource>
</form>
</body>
</html>