0

I am trying to store HTML and hyperlinks in my SQL server 2008 database. I want to also be able to display the hyperlinks and render the HTML accordingly. I am trying to do this in ASP.NET MVC, so I tried using the HTTPUtility.HtmlEncode() method, but didn't really store it the way I wanted. So can anyone please guide me through the steps I need to take to achieve this.

1
  • 5
    Silly game. The only way to win is not to play. Commented Jun 2, 2010 at 1:22

1 Answer 1

1

I think the best approach would be the MVC way in that you have a PartialView for each link. Then all you need to do is itterate through your collection of links and render a Partial View accordingly.

edit

When i say collection of links, i mean a collection of non html links. Just the addresses.

In your controller you might have;

List<string> links = fillList();
Return View(links);

Then in your view;

foreach(string item in Model.links)
  Html.Renderpartial("htmlLink", item);
Sign up to request clarification or add additional context in comments.

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.