What I’m trying to do is create a Gridview and in the grid have a HyperLinkField it send me to a detail page for that item, I have the part that filled the grid and the link and how to pass the id of the element to another page
The problem I have is that when I run and click on the link shows me the details page that I want but is blank. when I debugged, I don’t reach the details page
here is my code
fill the grid
var datos = db.Ticket
GridView1.DataSource = datos;
GridView1.DataBind();
show the GridView
<asp:GridView ID="GridView1" runat="server">
<Columns>
<asp:HyperLinkField HeaderText="Ver Ticket" Text="Ir Historial Ticket" DataNavigateUrlFormatString="~/DetailTicket.aspx?id={0}" DataNavigateUrlFields="IdTicket" />
</Columns>
</asp:GridView>
the detail page
public partial class DetailTicket: System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["id"] != null)
var id= Request.QueryString["id"];
var datos = db.detailTicket.Where(e=>e.IdTicket==id)
GridView1.DataSource = datos;
GridView1.DataBind();
}
}
Hey it might be issue with your path…
I have test your code and its working fine with me….