Hi Monika
In place of hyperlink, use asp:lnikbutton as below:
<asp:TemplateColumn>
<ItemTemplate>
<asp:LinkButton Runat=server CommandName="lnk">Add New</asp:LinkButton>
</ItemTemplate>
</asp:TemplateColumn>
Now the event that is fired when you click the linkbutton is the ItemCreated event of DataGrid which is as follows, we gave the commandName to uniquely identify this link button.
protected void dgGrid_OnItemCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
if (e.CommandName == "lnk")
{
}
}
Regards
Mike
|