I an ASP.NET MVC we can pass some data via a ViewData and then show it on a page:
<%: ViewData["Foo"]%>
But how to make a hyperlink out of it?
Something like following:
<%: Html.ActionLink(ViewData["Foo"], "Index", "Home") %>
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.
Cast it to
string:In general, however, try to avoid using
ViewDataand use a strongly typedViewModelinstead. (Thus, you would have avoided the problem in this question, btw).