Solved

Gridview Cell Onclick Window.Open http Issue?

Posted on 2014-03-28
3
262 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now