My code isn't 'exactly' the same as that, but works in the same way.
So currently. My code reads...
//HEAD
@{
var db = Database.Open("firstdatabase");
var sqlQ = "SELECT * FROM firsttable RIGHT JOIN slideroptions ON firsttable.layout=slideroptions.id";
var allfirsttableproducts = db.Query(sqlQ);
}
//BODY
<div class="fullwidthbanner">
<ul>
@foreach(var row in allfirsttableproducts)
{
<li>
@row.background.ToString()
</li>
}
</ul>
</div>
// When i run the page and view the source code the area that that is posting reads like the following
<div class="fullwidthbanner">
<ul>
<li>
<img src="slider/background/plainwhite.jpg" alt="" />
</li>
</ul>
</div>
Can i put each one to a readable HTML string, but inside the loop?
I have a slider of products which i want to be able to amend from inside a CMS.
Depending on templates chosen from within this cms it should apply different html (from the left join)
Hope this make sense, can't believe its that hard to display HTML from db?
Member
17 Points
56 Posts
Re: Storing HTML in SQL and posting to page
Aug 12, 2013 03:40 AM|happysack|LINK
Ok..
My code isn't 'exactly' the same as that, but works in the same way.
So currently. My code reads...
Can i put each one to a readable HTML string, but inside the loop?
I have a slider of products which i want to be able to amend from inside a CMS.
Depending on templates chosen from within this cms it should apply different html (from the left join)
Hope this make sense, can't believe its that hard to display HTML from db?
Thanks for your help so far!