Narasiman nar

Narasiman nar

  • 2.1k
  • 64
  • 13.5k

Redirect page in c# not working

May 27 2018 10:56 AM
 
 farmermanagement.aspx page
 
 i have gridveiw as follows
 
 
    id            Name        Dateofbirth    GovCode     Action
 
  54041       BEH SOUN    1/1/1977           419037X        Edit   Delete
  54042     ABOUD        9/5/1978            419037X       Edit    Delete
 
 When i click edit it need redirect to another page farmermaster.aspx. 
 
 But when i click the edit it does not redirect to another page farmermaster.aspx. it will stays in farmermanagement.aspx page only.
 
 Edit code as follows
 
protected void onCommand(object sender, CommandEventArgs e)
    if (e.CommandName == "Edit")
      {
  Response.Redirect("~/ivorycoast/farmermaster.aspx?action=edit&farmercode=" +   e.CommandArgument.ToString() + "", false);
  HttpContext.Current.ApplicationInstance.CompleteRequest();
      } 
 
what is the mistake in my above code. what changes i have to made in my above code. shows that when i click the edit it will redirect to  farmermaster.aspx
 

Answers (2)