I am able to save data from the radEditor to my table in SQL but can't load data into the editor from the same table. What am I doing wrong?
Here's my code:
}
Here's my code:
public
static DataView GetSparcHelpContent(string pagePath)
{
Database db = DatabaseFactory.CreateDatabase();
DataView dv = db.ExecuteDataSet("uspGetSparcHelpContent", pagePath).Tables[0].DefaultView;
return dv;
}
<
asp:ObjectDataSource ID="odsHelpContent" runat="server" TypeName="Wf.Sparc.DAL.DbAccess" SelectMethod="
GetSparcHelpContent
">
</
asp:ObjectDataSource>
<
asp:LinkButton ID="PageIns" runat="server" Text="View / Edit Help" Font-Underline="true"
toolTip="View more information related to this page" Visible="true" ></asp:LinkButton>
<asp:Panel ID="ModalPanel" runat="server" style="display:none; width:480px; height:530px; background-color:White;
border-width:2px; border-color:Black; border-style:solid; padding:20px;" DataSourceID="odsHelpContent" >
<asp:Button ID="OKButton" runat="server" Text="Close" ForeColor="Black" /> <br /><br />
<telerik:RadEditor ID="radBody" ToolbarMode="Default" ToolsFile="~/RadControls/ToolsFile.xml" runat="server"
ContentFilters="RemoveScripts" EditModes="All" Height="450" SkinID="RadEditorSkin" Visible="true"
Width="200" EnableResize="true" Content='<%# Bind("pageContent") %>'/>
<script type="text/javascript">
//This script must be below the RadEditor declaration
//It displays the custom toolbar icon formatting FAQ
//It replaces embedded scripts from a previous version of Telerik RadEditor
Telerik.Web.UI.Editor.CommandList[
"FormattingFAQ"] = function (commandName, editor, args) {
var args = editor.get_html(true) //returns the HTML of the selection.
editor.showExternalDialog(
"/RadControls/FormattingFAQ.aspx",
args,
350,
250,
null,
null,
"Formatting FAQ",
true,
Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move,
true,
true);
};
</script>
<br /><br />
<asp:Button ID="SaveButton" runat="server" Text="Save" ForeColor="Black" OnClientClick="needToConfirm = false;" OnClick="btnSave_Click" />
<asp:Button ID="CancelButton" runat="server" Text="Cancel" ForeColor="Black" /> <br /><br /> <br /><br />
</asp:Panel>
<ajaxToolkit:ModalPopupExtender ID="mpePopup" runat="server" TargetControlId="PageIns" PopupControlID="ModalPanel"
CancelControlID="CancelButton" OkControlID="OKButton" X="1050" Y="50" Drag="true" PopupDragHandleControlID="ModalPanel"/>
protected
void btnSave_Click(object sender, EventArgs e)
{
string pagePath = System.Web.HttpContext.Current.Request.Path.ToString();
Wf.Sparc.DAL.
DbAccess.UpdSparcHelpContent("ins", pagePath, radBody.Content, int.Parse(Session["userid"].ToString()));
}