Try this:
For View button:
<asp:templatefield headertext="No Of Seats" xmlns:asp="#unknown">
<itemtemplate>
<asp:linkbutton id="LinkButton1" runat="server"
postbackurl="<%#Eval("id","Yourpage.aspx?id={0}") %>" forecolor="Red">
Go to.</asp:linkbutton> >
</itemtemplate>
</asp:templatefield>
For Delete Button:
Use
RowCommand Event
<asp:templatefield headertext="Delete" xmlns:asp="#unknown">
<itemtemplate>
<asp:imagebutton id="ImageButton3" runat="server">
ImageUrl ="../image/delete.png" CommandName ="Delete" OnClientClick="return confirm("Are you sure you want to delete this entry?");" />
</asp:imagebutton></itemtemplate>
</asp:templatefield>
In .cs page:
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
try
{
if (e.CommandName == "Delete")
{
ImageButton img = (ImageButton)e.CommandSource as ImageButton;
GridViewRow row = img.NamingContainer as GridViewRow;
Label lbid = (Label)row.FindControl("label1");
bid = Convert.ToInt32(lbid.Text);
}
}
catch (Exception ex)
{
Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "Script", "alert('Cannot be Deleted because it is used in other Pages!!!');", true);
}
}
you can achieve view process in rowcommand also