1. Correct:
<A href = 'showfile. aspx? Id = <% # databinder. eval (container. dataitem, "ID") %> '> View File </a>
Ii. Error:
<A href = "showfile. aspx? Id = <% # databinder. eval (container. dataitem, 'id') %> "> View File </a>
Handling Method of too many characters in character text... Double quotation marks are always written without errors. What is your ID? Is it a number or a group of numbers, maybe a group of numbers. A group of numbers with symbols <% # databinder. eval (container. dataitem, 'id') %> ">
When you write it in the aspx file, <%> is equivalent to writing it in the CS file, which is the C # syntax. Then, ''is a definition character in C, the character can only be 1 character, so you will be prompted to handle too many characters in the character text. <% # Eval ("ID") %>
<% # Eval ("ID", "<a href = http://topic.csdn.net/u/20080379/09/'showfile.aspx? Id = {0} '> View File </a> ") %>
The best way to write this code is to follow me:
<% # Databinder. eval (container, "dataitem. musicname"). tostring (). length> 10? Databinder. eval (container, "dataitem. musicname "). tostring (). substring (0, 10) + "... ": databinder. eval (container, "dataitem. musicname "). tostring () %>