1

Hi I am trying to join two bits of information on an MVC view to create one long string on screen. I have a bit of text within <\a> and a returned variable in the model (model.item.number).

Currently I have the following in my view :

a>01643< / a> @Html.DisplayFor(modelItem => item.phone)

this returns the correct value, but gives a space between 01634 and the item.phone value. I have tried wrapping the whole thing with < a > but to no avail.

I am sure this is dead simple & so easy in webforms. can someone put me out of my misery and let me know how to do this.. I'm an MVC3 noob.

1 Answer 1

2

Remove the space:

a>01643</a>@Html.DisplayFor(modelItem => item.phone)

Or, Just write the value:

a>01643< / a>@Html.DisplayText(Model.item.phone)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.