I'm trying to build a link to an external website using some properties of my model class in my view page, e.g. I want it to render as something like -
< a href="http://twitter.com/home?status=Currently reading http://www.mywebsite.com/post-id">Twitter < /a>
where post-id would be pulled from the model (I'm using a strongly typed view model here - I can't use ViewData as there's a list of items being pulled back all of which need seperate links).
I tried doing < a href="<% model.PermaLink(); %>">, where PermaLink is just some string, however the value doesn't get picked up.
If I try < a href="<%= model.PermaLink %>">, I get an error - CS1502: The best overloaded method match for 'System.IO.TextWriter.Write(char)' has some invalid arguments
Is there any way to do this? I tried adding the runat="server" attribute, however this just linked to my local site and controller/model actions.