Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3420634
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:02:01+00:00 2026-05-18T06:02:01+00:00

I have an html helper which takes in a broken address and formats it,

  • 0

I have an html helper which takes in a broken address and formats it, but i’m seeing the actual <br /> tag as text instead of a line break on my web page.
What am i doing that’s causing this to occur?

Here’s part of my helper method

public static HtmlFormatAddress(this helper,   string number
    , string fraction
    , string direction
    , string street
    , string type
    ....)
{
    var sb = new StringBuilder();
    if (!string.IsNullOrEmpty(number))
        sb.Append(number.Trim() + " ");
    if (!string.IsNullOrEmpty(fraction))
        sb.Append(fraction.Trim() + " ");
    if (!string.IsNullOrEmpty(direction))
        sb.Append(direction.Trim() + " ");
    if (!string.IsNullOrEmpty(street))
        sb.Append(street + " ");
    if (!string.IsNullOrEmpty(type))

    if (sb.Length > 0)
        sb.Append("<br />");
    .....
    return sb.ToString();
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T06:02:01+00:00Added an answer on May 18, 2026 at 6:02 am

    If this is MVC2/ASP.NET 4, you need to return an MvcHtmlString instead of String

    If not, then be sure you are not encoding the output with <%: %> but instead use <%= %>

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have my own html helper extension, which I use this way <%=Html.LocalizableLabelFor(model =>
I am trying to create my own HTML Helper which takes in an expression
How do I create an ASP.Net MVC Helper for an Html.Label which takes in
I have created a binding to create a tag for Html.ActionLink html helper like
so here it goes: I have a html helper which renders ActionLink s with
I have a method helper which reads files and directory and build html view.
If I have an HTML helper like so: Name:<br /> <%=Html.TextBox(txtName,20) %><br /> How
I have extended the ASP.NET MVC Html Helper to include my own ValidationImage that
I have a small helper app that I use to inject scripts into html
Ok guys I basically have a class which takes in 3 strings through the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.