Link to home
Start Free TrialLog in
Avatar of Camillia
CamilliaFlag for United States of America

asked on

Binding to email in repeater

I have the code below but it's not binding correctly. It's in a repeater. It binds as such:

Email: < %# Bind("Email") % > 

That's actually the display. I bet i'm missing a single quote somewhere but i dont know...
<tr>
                    <td width="137"><label for="email_address_staff">Email:</label></td>
                    <td width="310">
                    <asp:HyperLink NavigateUrl='< %# Bind("Email", "mailto:{0}") % >' Text='< %# Bind("Email") % >' runat="server" ID="hlEmail"/>
                    </td>
                    <td width="280">&nbsp;</td>
                  </tr>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of codingbeaver
codingbeaver
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sorry, just realized the link is exactly the same as yours. What do you mean it is not binding correctly?
Avatar of Camillia

ASKER

Just fixed it. Yes, i got mine also from that link. But this time, it works! I changed the double quotes and now it's fine:


<asp:HyperLink NavigateUrl='<%# Bind("Email", "mailto:{0}") %>' Text='<%# Bind("Email") %>' runat="server" ID="hlEmail"></asp:HyperLink>
There should not be any space between "<" and "%".

<%# ...

Not

< %#