<asp:HyperLink
ID="HyperLink8"
runat="server"
Text='<%# String.Format("{0} {1} {2} {3}", Eval("Address"), Eval("City"), Eval("State"), Eval("ZipCode")) %>'
NavigateUrl='<%# String.Format("
http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q={
0}", Server.UrlEncode(String.Fo
rmat("{0} {1} {2} {3}", Eval("Address"), Eval("City"), Eval("State"), Eval("ZipCode")))) %>'>
</asp:HyperLink>
Just copy the line again otherwise you would have to introduce a variable or new property.
Sometimes I like to introduce a calculated property within the bound object to produce these results:
public string Location
{
get { return String.Format("{0} {1} {2} {3}", Eval("Address"), Eval("City"), Eval("State"), Eval("ZipCode")); }
}
<asp:HyperLink
ID="HyperLink8"
runat="server"
Text='<%# Eval("Location") %>'
NavigateUrl='<%# String.Format("
http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q={
0}", Server.UrlEncode(Eval("Loc
ation"))) %>'>
</asp:HyperLink>
DaTribe