Self-built http://www.velocityreviews.com/forums/t122096-simple-but-baffling-javascript-prob.html
If you directly use:
<A href = '# 'onclick = "passvalue (' <% # databinder. eval (container. dataitem," file_no ") %> '); Return false">
<% # Databinder. eval (container. dataitem, "sort_nm") %> </a>
GeneratedCodeLike:
<A href = '# 'onclick = "passvalue (' <% # databinder. eval (container. dataitem," file_no ") %> '); Return false">
XXXXX </a>
The data binding expression in the previous section is not parsed.
There are two solutions:
I. Use Custom Attributes of HTML elements
<A href = '# 'onclick = "passvalue (this); Return false" param1 =' <% # databinder. eval (container. dataitem, "file_no") %> '>
<% # Databinder. eval (container. dataitem, "sort_nm") %> </a>
Modify passvalue and use the param1 attribute to set the value.
Ii. use JavaScript's "+" operation to rearrange HTML (not verified by the citation)
<A href = '# 'onclick =
"Passvalue ('"
+
<% # Databinder. eval (container. dataitem, "file_no") %>
+
"'); Return false">
<% # Databinder. eval (container. dataitem, "sort_nm") %> </a>
3. Splice characters into the server code
<A href = '# 'onclick =' <% # "passvalue (" "& databinder. eval (container. dataitem, "file_no") & ""); Return false "%> '>
<% # Databinder. eval (container. dataitem, "sort_nm") %> </a>
4. Use datarowbound event
What is the most flexible solution?