tags:

views:

41

answers:

1

Hi,

I use jquery to fill a asp:label

Jquery code:

$("#more15").text(<p> <b>Hello WOrld!</b> </p>);

Asp .net code:

<asp:Label runat="server" ID="more15" Text="" Font-Size="Small" Font-Italic="False"></asp:Label>

When I view the page it is shown like this:

<p> <b>Hello WOrld!</b> </p>

instead of:

Hello WOrld!

how could I fix this problem?

Thanks /Mikael

+5  A: 

Use the html method instead of the text method.

$("#more15").html("<p> <b>Hello WOrld!</b> </p>");
Quintin Robinson
+1 - Needs a `#` in there to be completely correct, may want to update it for others :)
Nick Craver
@Nick Craver good catch, updated.. guess we should take into consideration the version of asp.net in use also.. it might need to resolve the rendered id as well but I will leave that to the op/viewer.
Quintin Robinson