Solved

Gridview Cell Onclick Window.Open http Issue?

Posted on 2014-03-28
3
264 Views
Last Modified: 2014-04-08
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
Comment
Question by:WorknHardr
  • 2
3 Comments
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 39961651
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
 

Accepted Solution

by:
WorknHardr earned 0 total points
ID: 39973811
I restarted VS2012 and now it's working
0
 

Author Closing Comment

by:WorknHardr
ID: 39985529
thx
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question