Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi i have a grid view which i need to act like a hyperlink.This hyperlink should pass the value in ID column in that row to a new page "home.aspx"
help me with the code and what all should i do..
Posted

Add this event to gridview.
C#
protected void Gridview_RowDataBound(Object sender, GridViewRowEventArgs e)
    {
    if (e.Row.RowType == DataControlRowType.DataRow)
    {
        e.Row.Attributes.Add("onclick", "self.window.open('http://www.google.com','_blank','width=1000, height=700');");
    }

}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900