Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Link button code as follows

C#
protected void lnkCbndate_Click(object sender, EventArgs e)
 {
     GridViewRow gv = (GridViewRow)((LinkButton)sender).NamingContainer;
     LinkButton lnkselectedrow = sender as LinkButton;

    if (lnkselectedrow != null)
      {
        GridView gvpkgname = (GridView)gv.FindControl("cpm_pkg_id");

        if (gvpkgname != null)
         {

            LinkButton btn = (LinkButton)gv.FindControl("cpm_pkg_id");
            String sql;
            SqlDataReader dr;
            sql = "OH_PKG_DATE_COMBINATION '" + "cpm_pkg_id" + "'";
            dr = scon.ReadSql(sql);
            gvpkgname.DataSource = dr;
            gvpkgname.DataBind();
         }
      }

 }

ASp.net page source code as follows

ASP.NET
  <asp:LinkButton ID="lnkCbndate" Text="Show available Combination batch dates" OnClick="lnkCbndate_click"

CommandName='<%#DataBinder.Eval( Container.DataItem, "cpm_pkg_id") %>'
                                                                                CommandArgument='<%#DataBinder.Eval( Container.DataItem, "cpm_pkg_name") %>' runat="server">


When i run shows error as follows

it does not contain a definition for lnkCbndate_click (link button)

from my above code what is the mistake i made?

please help me.
Posted
Updated 14-Jul-15 2:10am
v2

1 solution

It is case sensitive. Notice your event is _Click with upper case C but in the aspx you have lower case _click.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900