|
Hi all, can someone please explain what the Eval expression in the following gridview syntax does.
<asp:TemplateField HeaderText="ID" >
<ItemTemplate>
<asp:HyperLink ID="hlID" runat="server" Text='<%# EVAL("ID") %>' NavigateUrl='<%#"Default.aspx?ID=" + EVAL("ID") %>'/>
</ItemTemplate>
</asp:TemplateField>
In the NavigateURL property, I understand that Default.asx is a file name but what does the expression ID=" + EVAL("ID") do? Thanks in advance for your reply.
|
|
|
|
|
|
Hi, thanks for replying. I still have one question about the Eval expression. What happens when the hyperlink is clicked due to the fact that the ID' field of the datasource is bounded to the text property of the hyperlink? Is the ID sent to the Default.aspx page when the hyperlink is clicked? Thanks in advance for your reply.
modified 16-Sep-12 3:45am.
|
|
|
|
|
No. It's just the text field that is bounded to field in Eval method. It's not sent to anywhere when hyperlink is clicked. You can take/consider it as a runtime text assignment.
|
|
|
|