Please help me..
When i code in my PC for this programming it is running without any error, but when i release it to server i Encountered error Compiler Error Message: CS1061: 'ASP. registration_aspx' does not contain a definition for 'btnDeactivate_Onclick' and no extension method 'btnDeactivate_Onclick' accepting a first argument of type 'ASP. registration_aspx' could be found (are you missing a using directive or an assembly reference?)
aspx code :
<asp:GridView ID="gvData" runat="server" AllowPaging="true" PageSize="20" AutoGenerateColumns="false"
PagerSettings-Visible="false" HeaderStyle-CssClass="GV_Header " RowStyle-CssClass="GV_Row" EnableModelValidation="True"
Width="100%" OnSelectedIndexChanging="btnDeactivate_Onclick" OnRowCommand="gvData_RowCommand"
DataKeyNames="rebate_code" >
<asp:TemplateField HeaderText="">
<ItemStyle HorizontalAlign="Center" Width="50px"></ItemStyle>
<ItemTemplate>
<asp:ImageButton ImageUrl="~/Images/comm_img/disable.png" ID="Deactivate" runat="server"
ToolTip="Deactivate" CommandName="Select"
CommandArgument='<%# Eval("rebate_code") %>' />
</ItemTemplate>
</asp:TemplateField>
aspx.cs code :
protected void btnDeactivate_Onclick(object sender, GridViewSelectEventArgs e)
{
//only fanliyee & chloe can deactivate the lump sum rebate
if ((Session["LoginName"].ToString()) == "fanliyee" || (Session["LoginName"].ToString()) == "chloelimenghui")
{
string RebateCode = gvData.DataKeys[e.NewSelectedIndex].Value.ToString();
GridViewRow row = (GridViewRow)gvData.Rows[e.NewSelectedIndex];
int rowUpdate = 0;
DataSet result = new DataSet();
result = BO_Rebate.Deactivate_RebateLS_List(Session["LoginName"].ToString(), RebateCode);
rowUpdate = Convert.ToInt32(result.Tables[0].Rows[0]["ReturnValue"]);
if (rowUpdate != 0)
{
BindData();
//gvData.EditIndex = -1;
//gvData.DataBind();
Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('Deactivated succesfully');", true);
return;
}
else
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('Deactivated failed !');", true);
return;
}
}
else
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('User is not eligible to perform this function !');", true);
return;
}
}