QUOTE(Sim270 @ 17 Oct, 2007 - 06:36 AM)

I have one gridview with the <a href> tag in the template column.
In href i have given the path to documents which reside in the folder present in the application directory.these path will be dynamically generated and binded in design with eval("column_name") to the href property.
But now i want to perform some server side processing also taking the name and path of the link
along with opening of the doc in the new window ,on click of the link
So i changed the html links to link button but m not able to get the proper approach to go for it.....
Can anybody tell the best approach which can be followed for .
can i use something other than link button.
In your GridView1_RowDataBound Method you should add the onclick attribute to the hyperlink and set its value to a Javascript method that would do whatever you want it to do when the user clicks the link. your method should look like:
//In Code Behind
protected void gGridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
HyperLink hyplnk = (HyperLink)e.Row.FindControl("hyperlinkName");
hyplnk.Attributes.Add("onclick", "ShowModalPopup()");
}
}
//In markup
<a href='<%# Eval("link")%>'><%# Eval("title") %></a>