Displaying saved database content

Last post 10-29-2009, 3:32 PM by spencet. 4 replies.
Sort Posts: Previous Next
  •  10-29-2009, 8:23 AM 56781

    Displaying saved database content

    I can save my Editor content to the database but having trouble displaying/rendering the content back out on a page when I pull it back out of my MSSQL database.
     
    Have a table called 'CMS_PAGES and I'm saving the editor output into a field called 'pages_body'. This is the HTML data contained in that field for example:
      
      <div><img alt="" src="http://cutesoft.net/uploads/CLC Logo 1.gif" width="125" height="99" /></div><div>This is an image! <br /></div>
     
    Here is my VB.NET code for grabbing that data from the table and storing it into a variable:
          NOTE: The '1' represents the page_id I'm passing into my function
     
          strPageContent = pageContentAdapter.GetPageContent("1").ToString
     
    On the output end, I've tried just displaying the variable on a page '<%# strPageContent %>', tried sticking it in a label 'Label.Text = strPageContent', etc...and nothing is outputing the value from the table. All I get is an output of the table name, 'CMS_PAGES' on my output page. Any suggestions???
     
    Thanks
  •  10-29-2009, 9:51 AM 56784 in reply to 56781

    Re: Displaying saved database content

    spencet,
     
    You can get and set the content of Cute Editor using Editor.Text property.
     

    Editor.Text Property

    This property provides access to the text within the editable area of the CuteEditor control. It can be used to set the text when the control is first displayed and also to read out the text when a form has been submitted.

     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  10-29-2009, 10:47 AM 56790 in reply to 56784

    Re: Displaying saved database content

    Yes, and I have no problem accessing the Editor.Text property to store data into my database. But on my display page, I'm needing to show the stored data from my table back onto the page not from the Editor.text. Is there example code that shows how to display saved Editor text that is not bound to a DataGrid control but rather to a variable or label that will render the HTML correctly?
  •  10-29-2009, 1:57 PM 56793 in reply to 56790

    Re: Displaying saved database content

  •  10-29-2009, 3:32 PM 56797 in reply to 56793

    Re: Displaying saved database content

    Tried both:
     
     <%= strPageContent %>
     
    and 
     
     <%# strPageContent %> 
     
    to no avail. Still just getting 'cms_pages' output on my page, which is the name of the table, instead of the actual table field content which should be '<div><img alt="" src="http://cutesoft.net/uploads/CLC Logo 1.gif" width="125" height="99" /></div><div>This is an image! <br /></div>'.
View as RSS news feed in XML