Hi h_tam,
Thank you for using Microsoft Newsgroup Service. As for the question you
mentioned, here is my suggestion:
In case that you want to use some quote ("") in the <%# %> bound, you
should use ' to
include the <%# %> rather than use ", For example:
<ItemTemplate>
<asp:HyperLink NavigateUrl='<%# "target.aspx?id="
+DataBinder.Eval(Container.DataItem,"id")%>' runat="server"
ID="lnkNav">view</asp:HyperLink>
</ItemTemplate>
But be careful that don't include other text in the '' beside the <%# %>,
such as:
<asp:HyperLink NavigateUrl='other text<%# "target.aspx?id="
+DataBinder.Eval(Container.DataItem,"id")%>' runat="server"
ID="lnkNav">view</asp:HyperLink>
That'll cause all the expression between '' be analyzed as a normal string.
The <%# ........%> bound will be output as plain text.
In addition, if your expression is too complex which contains more than two
hierarchy of quote, I think there does exist some limit on analysis the
quotes for VS.NET IDE.
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)