Click here to Skip to main content
12,446,146 members (27,899 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB ASP.NET
I have a problem in my code.
I always have an error.

Here is my code

<pre lang="xml"><asp:GridView ID="GridView1" runat="server"
              AutoGenerateColumns="False"
              DataKeyNames="ID"
              DataSourceID="SqlDataSource1"
              OnRowDeleted="GridView1_RowDeleted"
              OnRowUpdated="GridView1_RowUpdated"
              ShowFooter="true"
              OnRowCommand="GridView1_RowCommand">
<Columns>
    <asp:CommandField ShowDeleteButton="True"
                      ShowEditButton="True" />
    <asp:TemplateField HeaderText="ID" SortExpression="ID">
    <ItemTemplate>
    <asp:Label ID="lblID" runat="server"
                          Text='<%#Eval("ID") %>'>
    </asp:Label>
    </ItemTemplate>
    <FooterTemplate>
    <asp:Button ID="btnInsert" runat="server"
                Text="Insert" CommandName="Add" />
    </FooterTemplate>
    </asp:TemplateField>
 
    <asp:TemplateField HeaderText="FirstName"
                       SortExpression="FirstName">
    <ItemTemplate>
    <asp:Label ID="lblFirstName" runat="server"
               Text='<%#Eval("FirstName") %>'>




And the error is "it is not a member of 'ASP.default_aspx.'"
I hope you can help me.
Thanks a lot!
Posted 4-May-11 19:53pm
Updated 4-May-11 19:58pm
v2
Comments
S Mewara 5-May-11 2:15am
   
There must be some event name before the error. What is not the member?
Share the complete error.
bsb25 6-May-11 4:41am
   
give the full exception or the error part...we can't help without tat
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

Make sure that youre namespaces, classes and events are correctly named. Make sure that you have a GridView1_RowCommand in the code behind class in the right namespace. This is most probably the error.

It happens when you rename the name of the class or file and forget to also rename the class or vice versa.
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 4

Those are event handlers that don't exist in your code-behind file. You have to add them, and then it should be good to go.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160811.3 | Last Updated 6 May 2011
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100