Gridview Cell Onclick Window.Open http Issue?

Using VS2010 ASP.NET
The following code works fine until I add the http:// before the url. I need the Cells[1] text variable.
 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
 {
       if (e.Row.RowType == DataControlRowType.DataRow)
       {
            e.Row.Cells[4].Attributes["onclick"] = "window.open('http://mycompanysite/Prices/AddEdit.aspx?id=" + e.Row.Cells[1].Text + "')";
       }
}

Open in new window

WorknHardrAsked:
Who is Participating?
 
WorknHardrConnect With a Mentor Author Commented:
I restarted VS2012 and now it's working
0
 
Carl TawnSystems and Integration DeveloperCommented:
In what way does it "not work"? Is it throwing an exception server side, or just not producing the expected output on the client side?

Can you post a sample of the link generated on the client?
0
 
WorknHardrAuthor Commented:
thx
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.