Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 274
  • Last Modified:

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

0
WorknHardr
Asked:
WorknHardr
  • 2
1 Solution
 
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:
I restarted VS2012 and now it's working
0
 
WorknHardrAuthor Commented:
thx
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now