Is it possible in MVC2 to create an anchor tag that contains values from ViewData?
e.g.
<a href="mailto:<%: ViewData["Email"] %>">Send Email</a>
This code above doesn’t render and just throws an exception?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
The answer here is not as complicated as many would think.. it’s simply a Quote (“) problem:
Try changing your outer quotes to single quotes.. It terminates the string when you use ” quotes in your markup aswell as in the [“Email”]… 🙂