I have to admit to start that I am relatively new to ASP.NET and shamefully have not really used server tags on the client side page yet. I have a repeater on my page that iterates through the rows of a datatable and shows a hyperlink object for each item using the below tag:
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/DiseaseInfo/Syndrome.aspx?SyndromeID=<%# Eval('SYNDROME_ID')%>&SpeciesID=<%# Eval('SPECIES_ID')%>" Text='<%# Eval("SYNDROME_NAME").ToString%>'></asp:HyperLink>
The problem that I am having is that the server doesn't render out the <%# %> tags. If I put this same link into an tag then it works just fine. I am sure that it has to do with the fact that the hyperlink is already being rendered on the server-side, but I can't figure out how to change things to get it to work correctly. Any help would be greatly appreciated.
Here is how I ended up handling this:
Reverse the order of your single / double quotes.
This normally doesn't matter at a JavaScript / HTML level but the correct quote for C# / VB is a double quote which should be used within the
Eval()
method.A slightly better approach would be to invoke a method to return this somewhat complex url: