ritchamp
-
11/17/2011 9:10:41 AM
Adding a editable text web control in a .aspx page in visual studio 2008
Hi,
I need to show an editable region in my aspx page so that administrator can edit the content when needed.
Since it is an ASPX page template, not portal template, i used following steps to inherit the editable text web part.
1. i tried to directly inherit the editable text web part in my aspx page.
<%@ Register TagPrefix="UC" TagName="EditableText" Src="~/CMSWebParts/Text/editabletext.ascx" %> <UC:EditableText ID="editableText" runat="server" RegionType="HtmlEditor" HtmlAreaToolbarLocation="Out:FCKToolbar" WordWrap="true" CheckPermissions="false" SelectOnlyPublished="false" />
with the above code i got following error:
You must enable Web Parts by adding a WebPartManager to your page. The WebPartManager must be placed before any Web Part controls on the page.
2. i created a new user control (.ascx) and placed the above code. i inherited the user control in my aspx page.
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="MyTestPage.ascx.cs" Inherits="CMSWebParts_GapWebParts_MyTestPage" %> <%@ Register TagPrefix="UC" TagName="EditableText" Src="~/CMSWebParts/Text/editabletext.ascx" %> <UC:EditableText ID="editableText" runat="server" RegionType="HtmlEditor" HtmlAreaToolbarLocation="Out:FCKToolbar" WordWrap="true" CheckPermissions="false" SelectOnlyPublished="false" />
With this change i was able to get the editable text, in my aspx page, but when i edit the content and click on save, it is throwing following error.
Error Message: A validation error has occurred.
A potentially dangerous Request.Form value was detected from the client (ctl00_plcMain_ucEdiatbleText_editableText_fckValue="...sting.....<br />").
Could you please help me to resolve this issue. Am i missing any attributes in my code.
|