I am new to asp.net but I have been a professional developer for a few years now and I have a few questions....
I am trying to make an updatable website where information such as title and content is added to the database and displayed on the website.
I have managed to display the content to a sample page but I am looking into repeating the code for many pages and also each page callback creates a database connection running a sql call everytime. problem is content will not change much and I want tor edcude overhead, maybe cache the data.
public partial class _Default : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
string connectionString =
conn = new SqlConnection(connectionString);
comm = new SqlCommand("SELECT m_name, m_text, m_id FROM pages WHERE m_id = 1", conn);
reader = comm.ExecuteReader();
contentHeader.Text = "<h1>" + Server.HtmlEncode(reader["m_name"].ToString()) + "</h1>";
View Complete Post