Hi,
I am using a gridview to display the records in my website. The first column of gridview is button of type "Link" (asp:ButtonField ButtonType="Link" CommandName="GETDETAILS" HeaderText="Name"). On the click of the link of a perticular row I want to redirect the user to the details page. But the response.redirect is not working. I tried all the options like Response.Redirect("A_Details.aspx", true) and Response.Redirect("A_Details.aspx", false) but it doesn't work and stays on the same page and no error is thrown. At the same it redirects perfectly when I open the website from the browser of the server machine where website is hosted. But when I try to redirect from the local machine's browser, nothing happens.
Here is the code for redirection:
protected void gvCases_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName.ToUpper() == "GETDETAILS")
{
int _index = Convert.ToInt32(e.CommandArgument);
//Create session var to be used in the details page.
Session["RecID"] = Convert.ToInt32(gvCases.Rows[_index].Cells[0].Text);
Response.Redirect("A_Details.aspx");
}
}
Any help is highly appreciated.
Thanks in advance.