E-Bat
E-Bat

Reputation: 4892

ASP.NET WebForm DataBoundControl controls: Rendering Formatted Fonts

<%#:string.Format("Home Phone: {0}",Item.Person.HomePhone)%>

In the previous binding definition for ASP.NET Webform DataBoundControl controls type, how can i render the phone number with formated font? For example bold:

Home Phone: 123456

An important detail es that "Home Phone:" is not formatted.

Upvotes: 0

Views: 44

Answers (2)

Win
Win

Reputation: 62260

The problem is whatever inside <%# %> will end up with html encoded.

You might want to try moving the html tag outside of binding.

Home Phone: <strong><%# Item.Person.HomePhone %></strong>

Upvotes: 1

suff trek
suff trek

Reputation: 39777

Try this:

<%#:string.Format("Home Phone: <b>{0}</b>",Item.Person.HomePhone)%>

Upvotes: 0

Related Questions