You are mixing your business logic with your content. Instead, I'd recommend sending the data to your page and then using something like JQuery to place the data where you need it to go.
This has the advantage of keeping all your HTML in the HTML pages where it belongs so your web designers can modify the HTML later without having to pour through server side code.
Or if you're not wanting to use JavaScript, you could try this:
@str = "Hi"
<b><%= @str ></b>
At least this way your HTML is in the HTML page where it belongs.