Link to home
Start Free TrialLog in
Avatar of elmbrook
elmbrook

asked on

Label replacement in MVC - linefeeds, carraige returns, <br /> replacements.

Hi

I have information from a number of different sources in my database which I would like to display to my user so what I did was I created a query to gather all the information.

To display the information, i did the following:

ViewData.Add("Details",fullname + "<br />" + partner + "<br />" + address + "<br />" + phone + "<br />" +
                cell + "<br /><br /><a href='myhyperlinkpage.aspx?id=" + id + "'>Edit My Details</a>" );

But it is all formatted incorrectly in the page. The <br /> tags show up as text and my link shows up as <a href='myhyperlinkpage.aspx?id=2046d69cfa888888015797'>Edit My Details</a>

How should I be doing this?
Avatar of Vipul Malani
Vipul Malani

you can return all this field in model and handle at client site to display that field.
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial