I've created a content management interface to allow content to be edited/changed. The HTML/text editor I used was Xinha. This part is working fine. The problem I am now having is pulling the data and having it display on the web page.
I've been stuck for days and I'm going crazy.
Everything seems to be working fine - connecting to the database and I've even been able to pull back the data when I do a response.write. The problem occurs when I attempt to use the variable that contains the html and attempt to display it. I get an error.
Database I'm using is Access and I'm using ASP.NET 1.1.
The code that I have in calendar.aspx.cs is:
public void Page_Load(object sender, System.EventArgs e)
this.cmdWebDisplay = new System.Data.OleDb.OleDbCommand();
// Put user code to initialize the page here
using(OleDbConnection connection = new OleDbConnection(Configuration.ConnectionInfo))
this.cmdWebDisplay.CommandText = "Select WebContent.Content FROM WebContent WHERE ((WebContent.PageID)= 1 ) AND ((WebContent.ContentID) = 1)";
this.cmdWebDisplay.Connection = connection;
System.Data.OleDb.OleDbDataReader oleReader = this.cmdWebDisplay.ExecuteReader();
htmltext = oleReader["Content"].ToString();
catch (OleDbException ex)
And then in the actual .aspx page I'm attempting to reference that htmltext variable.
I'm attempting to reference it by using <%=htmltext%> in my HTML.
When I run it, I get the following error:
CS0103: The name "htmltext" does not exist in the class or namespace 'ASP.calendar_aspx
Seems as if that code hasn't run before the page is loaded. What am I missing?