1
@Html.ActionLink(
    linkText: "Quote Number: "@item.QuoteNumber,
    actionName: "MyAction",
    controllerName: "Home",
)

I'm trying to do something as above to append the item quote number the literal label. QuoteNumber is a string.

2 Answers 2

3

You are in C#, so you can just append the strings. Something like:

@Html.ActionLink(
    linkText: "Quote Number: " + item.QuoteNumber,
    actionName: "MyAction",
    controllerName: "Home"
)
Sign up to request clarification or add additional context in comments.

Comments

2

you can use the following

@Html.ActionLink( linkText: string.Format("Quote Number: {0}",item.QuoteNumber), actionName: "MyAction", controllerName: "Home")

and if you want to pass values

@Html.ActionLink(string.Format("Quote Number: {0}",item.QuoteNumber), "MyAction","Home", new {id = item.QuoteNumber})

Hope this will help you

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.