In short I am working on a website that will end up being comprised of numerous very similar pages.
I was planning to employ a nested Site Masters storing the actual variable data in a SQL Database.
I am able to pull my HTML code from the data base using the following method.
This code in ASPX
Expand|Select|Wrap|Line Numbers
- <asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
- <asp:Literal ID="Header_Literal" runat="server"></asp:Literal>
- </asp:Content>
- <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
- <asp:Literal ID="Body_Literal" runat="server"></asp:Literal>
- </asp:Content>
Expand|Select|Wrap|Line Numbers
- Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
- Dim con As New System.Data.SqlClient.SqlConnection
- con.ConnectionString = "Data Source=XXXXXXXXXXX\SQLEXPRESS;Initial Catalog=master;Integrated Security=True"
- Dim adp As New System.Data.SqlClient.SqlDataAdapter("select * from XXXXXXXXXX", con)
- Dim dt As New System.Data.DataTable
- adp.Fill(dt)
- Header_Literal.Text = dt.Rows(0).Item("Meta_Tags")
- Body_Literal.Text = dt.Rows(0).Item("Page_Title")
- End Sub
The Literal ID=Body_Literal gets data, but it is comprised of html and an Inline code element. The HTML works, but the Inline code is being ignored.
I am guessing that this is a problem with me using the Literal control, but I am unclear what I should be using instead.
The content is plain text and the Inline was a calling a codebehind element to mask my email address.
What should I be doing here. Or just as valuable what should I be searching for to learn this on my own?