I am building a content management system and am using the MSHTML editing platform. Basically I have a contenteditable div tag where the user can perform basic word processing functions, like bold, italics and add links. The contenteditable div tag is being dynamically filled and placed on the page using a DataGrid (the contenteditable div is inside of a <edititemtemplate>). Also inside of the same edititemtemplate column is 3 other server controls (<asp:textbox>). This DataGrid also has an editcommandcolumn with an Edit, Update and Cancel button. Once the Update button is clicked I need to be able to grab the new text (using an Update subroutine) that is inside of the contenteditable div tag as well as all of the other server controls. So far, I can easily access the textbox's data by using:
Dim strDayTitle as String = CType(E.Item.FindControl("txtboxDayTitle"), TextBox).Text
I've tried accessing the contenteditable div tag's data by using:
Dim strDayText as String = CType(E.Item.FindControl("oDiv"), HtmlGenericControl).InnerHtml
But I keep receiving this error, "System.NullReferenceException: Object reference not set to an instance of an object." I've even tried this:
Dim strDayText as String = oDiv.InnerHtml
But I keep receiving the same error as above. How do I get the InnerHtml value out of a div tag in a DataGrid?
Thanks for your thoughts,