Question:
<asp:GridView ID=”GridView1″?? AutoGenerateColumns=”False” DataKeyNames=”Id”?
??????????? runat=”server” onrowediting=”GridView1_RowEditing”>
??????? <Columns>
??????? <asp:BoundField DataField=”Id” HeaderText=”ID” Visible=”False” />
??????? <asp:BoundField DataField=”FirstName” HeaderText=”First Name” />
??????? <asp:BoundField DataField=”LastName” HeaderText=”Last Name” />
??????? <asp:TemplateField>
??????????? <ItemTemplate>
??????????????? <asp:ImageButton ID=”imageButton” AlternateText=”Edit” CausesValidation=”false” CommandName=”Edit” runat=”server” />?
????香港vps??????? </ItemTemplate>
??????? </asp:TemplateField>
??????? </Columns>
??????? </asp:GridView>
public partial class _Default : System.Web.UI.Page
??? {
??????? public class Person
??????? {
??????????? public string FirstName { get; set; }
??????????? public string LastName { get; set; }
??????????? public int Id { get; set; }
??????? }
??????? protected void Page_Load(object sender, EventArgs e)
??????? {
??????????? if (!IsPostBack)
??????????? {
??????????????? List<Person> people = new List<Person>() { new Person { FirstName = “Mike”, Id = 1, LastName = “Myers” }, new Person() { FirstName = “含蓄的保温杯, Id = 2, LastName = “Smith” } };
??????????????? GridView1.DataSource = people;
??????????????? GridView1.DataBind();
??????????? }
??????? }
??????? protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
??????? {
??????? }
??? }
Solution:
change this?’edit’?to other string. ex. ‘edit1’…
<asp:ImageButton ID=”imageButton” AlternateText=”Edit” CausesValidation=”false” CommandName=”Edit” runat=”server” />?
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/310974/viewspace-1985053/,如需转载,请注明出处,否则将追究法律责任。 </p妩媚的烧鹅p高高的音响载于:http://blog.itpub.net/310974/viewspace-1985053/