b b

b b

  • NA
  • 53
  • 0

GridView Problem

May 11 2010 12:52 AM
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 + "')");
        }
}

Answers (1)