1

How can we display header text value 2 1/4'' in asp.net boundfield ? below is my code.

<asp:BoundField DataField="2 1/4"" HeaderText="2 1/4"" --82" ReadOnly="true" DataFormatString="{0:C2}" HtmlEncode="False" Visible="false">
        <HeaderStyle HorizontalAlign="Right" />
        <ItemStyle Width="40px" HorizontalAlign="Right" />
        </asp:BoundField>
Indra
  • 279
  • 2
  • 3
  • 16

2 Answers2

1

Single quotes are perfectly valid delimiters, you can use them when you need to put a double quote in your content.

HeaderText='2 1/4"'
nunespascal
  • 17,584
  • 2
  • 43
  • 46
0

You could also encode the double quote as

&quot;

Also see How to escape double quotes in title attribute there are lots of other recommendations and follow up reading.

Community
  • 1
  • 1
Ian G
  • 29,468
  • 21
  • 78
  • 92