InsideEdge
Instructor
Hi, I’m teaching myself Visual Studio.NET and I came across an example in my book that looks like this:
<SelectedItemTemplate>
<asp:HyperLink id=HyperLink2 runat="server" CssClass="DepartmentSelected" Text='<%# DataBinder.Eval(Container.DataItem, "Name") %>'
NavigateUrl='<%# "../default.aspx?DepartmentID=" & DataBinder.Eval(Container.DataItem, "departmentID") & "&DepartmentIndex=" & Container.ItemIndex %>'>
</asp:HyperLink>
</SelectedItemTemplate>
This is a hyperlink that is in a dataList control. There is an underlying database that the control reads from. The part that I’m confused about is the elements “Name” and “departmentID” of DataBinder.Eval(). Are those elements that should match strings from my database? Or can I just use any string here?
Thanks for your help with this one,
AlexanerBlade
<SelectedItemTemplate>
<asp:HyperLink id=HyperLink2 runat="server" CssClass="DepartmentSelected" Text='<%# DataBinder.Eval(Container.DataItem, "Name") %>'
NavigateUrl='<%# "../default.aspx?DepartmentID=" & DataBinder.Eval(Container.DataItem, "departmentID") & "&DepartmentIndex=" & Container.ItemIndex %>'>
</asp:HyperLink>
</SelectedItemTemplate>
This is a hyperlink that is in a dataList control. There is an underlying database that the control reads from. The part that I’m confused about is the elements “Name” and “departmentID” of DataBinder.Eval(). Are those elements that should match strings from my database? Or can I just use any string here?
Thanks for your help with this one,
AlexanerBlade