0

I am working in asp.net MVC 3 application with Razor view.

I have string where I need to add a link in it like this:

var closingMsg = "Thank you for submitting your dispute. If you wish, you may <a href='<%= Url.Action('Index', 'Product') %>purchase our SMS alert service</a> for immediate notification of any creditor response or request."; 

But it is giving error.

Please suggest how to do it using href or HTML.actionLink. I need to apply styles to link as well.

2
  • Could you show code of your view Commented Oct 22, 2012 at 12:36
  • You don't provide enough information to get good answers. Commented Oct 22, 2012 at 13:36

1 Answer 1

1

Razor uses @ rather than <% %>

So it would be like this

<a href='@Url.Action('Index', 'Product')...

This is quite fundamental and would recommend you take some beginner tutorials to familiarize yourself with the basics.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.