I'm creating a mini cms for my site. I want to create a page admin that let's users create pages and add meta tags to them page. So I've created a SQL Server database table with these columns:
[PageName](primary key)
,[Body] - used to pull the html of the page from the sql database
,[Title]
,[Description] - meta description
,[Keywords] - meta keywords
I created query string using the pagename column. So far I can get the body to show but none one of the meta information. This is what I've got so far:
<asp:Repeater runat="server" ID="Repeater1" DataSourceID="BodyContent">
<ItemTemplate>
<asp:Label ID="lblPage" runat="server" Text='<%# Eval("Body") %>' />
</ItemTemplate>
</asp:Repeater>
So for example my query string would be /c.aspx?pagename=test - this pulls the body content through correctly but nothing else.
SqlDataSource:
<asp:SqlDataSource ID="BodyContent" runat="server"
ConnectionString="<%$ ConnectionStrings:testDb %>"
SelectCommand="SELECT [PageName], [Body], [Title], [Description], [Keywords] FROM [PageAdmin] WHERE ([PageName] = @PageName)">
<SelectParameters>
<asp:QueryStringParameter Name="PageName" QueryStringField="PageName" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
How do I do the same to pull the title, keywords and description from the database?
Thanks