I have a Results.aspx page that displays the result records requested using the SqlDataSource object through a ListView. I want to add a View button that appears next to each entry, and when I click, it will lead to a separate page on which information about this entry will be displayed. How to do it?
Edit
I tried what you said, citrons, and here is what I came up with:
<td>
<asp:CheckBox ID="CheckBox1" runat="server" />
</td>
<td>
<asp:LinkButton ID="LinkButton1" runat="server" CommandName="ViewButtonClick" CommandArgument='<%# Eval("ServiceId") %>'>View</asp:LinkButton>
</td>
And here is the method I want to call:
protected void ViewButtonClick(object sender, CommandEventArgs e)
{
var serviceId = Convert.ToInt32(e.CommandArgument);
ServiceToView = DataAccessLayer.Service.Select(new Service { ServiceId = serviceId });
Server.Transfer("~/ViewService.aspx");
}
Unfortunately, nothing happens ... Am I missing something?
Edit - Fixed
- ! CommandName OnCommand. CommandName, CommandName OnCommand. , - CommandName?