1
Answer

GridView Problem

Ask a question
b b

b b

14y
2.2k
1
Hi All,
I have a Gridview and inside that grid view i have some link. Now when i click on the link inside GridView i want to open an URL. I have written the event in RowCommand event of the GridView and i am getting URL value also. But URL is not opening in first time i click on the link only second time i click on the link its opening,

I want it to open in first click. I am using C# with asp.net

eg:
GridView1_RowCommand()
{
    string url=www.xyz.com

    if (url != "")
        {
                       
            GridView1.Attributes.Add("onclick", "window.open('" + url + "')");
        }
}



Can anyone help.

regards,
bb

Answers (1)