7 Answers, 1 is accepted
0
Hi Matt,
The RemoveScripts client filter of RadEditor strips all script tags on submit or when switching to Html mode. It is enabled by default. If it is disabled on your side, you can enable it with
C#:
RadEditor1.EnableFilter(Telerik.Web.UI.EditorFilters.RemoveScripts);
Best regards,
Rumen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
The RemoveScripts client filter of RadEditor strips all script tags on submit or when switching to Html mode. It is enabled by default. If it is disabled on your side, you can enable it with
C#:
RadEditor1.EnableFilter(Telerik.Web.UI.EditorFilters.RemoveScripts);
Best regards,
Rumen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Matt
Top achievements
Rank 1
answered on 28 Oct 2008, 04:23 PM
Hi
The filter works when switching between HTML mode and design mode, however, if you just create a script in HTML mode and click the submit button the 'script' tags don't seem to get removed.
I have this in my code: -
The filter works when switching between HTML mode and design mode, however, if you just create a script in HTML mode and click the submit button the 'script' tags don't seem to get removed.
I have this in my code: -
RadEditor1.EnableFilter(EditorFilters.RemoveScripts)
Thanks
Matt
0
Hi Matt,
My suggestion is to programmatically switch to Design mode before submitting the content. Here is an example:
<telerik:RadEditor ID="RadEditor1" runat="server">
<asp:Button ID="Button1" runat="server" OnClientClick="SwitchEditor()" Text="Button" OnClick="Button1_Click" />
<asp:TextBox ID="TextBox1" runat="server" Height="127px" TextMode="MultiLine"></asp:TextBox>
<script type="text/javascript">
function SwitchEditor()
{
var editor = $find("RadEditor1");
editor.set_mode(1); //switch to Design mode
}
</script>
Codebehind:
protected void Button1_Click(object sender, EventArgs e)
{
TextBox1.Text = RadEditor1.Content;
}
Kind regards,
Rumen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
My suggestion is to programmatically switch to Design mode before submitting the content. Here is an example:
<telerik:RadEditor ID="RadEditor1" runat="server">
<asp:Button ID="Button1" runat="server" OnClientClick="SwitchEditor()" Text="Button" OnClick="Button1_Click" />
<asp:TextBox ID="TextBox1" runat="server" Height="127px" TextMode="MultiLine"></asp:TextBox>
<script type="text/javascript">
function SwitchEditor()
{
var editor = $find("RadEditor1");
editor.set_mode(1); //switch to Design mode
}
</script>
Codebehind:
protected void Button1_Click(object sender, EventArgs e)
{
TextBox1.Text = RadEditor1.Content;
}
Kind regards,
Rumen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Matt
Top achievements
Rank 1
answered on 28 Oct 2008, 04:42 PM
Thanks Rumen, that works fine, is there a way of making the HTML view button not appear at all?
0
Hello Matt,
Hiding the HTML mode is even easier and can be set with a property.
The following online demo demonstrates that:
http://demos.telerik.com/aspnet/prometheus/Editor/Examples/EditModes/DefaultCS.aspx
The property is EditModes ="Design,Preview"
Best wishes,
Tervel
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Hiding the HTML mode is even easier and can be set with a property.
The following online demo demonstrates that:
http://demos.telerik.com/aspnet/prometheus/Editor/Examples/EditModes/DefaultCS.aspx
The property is EditModes ="Design,Preview"
Best wishes,
Tervel
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Patrice Boissonneault
Top achievements
Rank 2
answered on 11 Apr 2011, 06:20 PM
Is it possible to do the same with a textbox multiline?
0
Hi Patrice,
Could you please explain what do you want to achieve? What do you mean by a multi-line textbox? Do you mean RadTextBox, a mult-iline Asp:TextBox or another control?
Kind regards,
Rumen
the Telerik team
Could you please explain what do you want to achieve? What do you mean by a multi-line textbox? Do you mean RadTextBox, a mult-iline Asp:TextBox or another control?
Kind regards,
Rumen
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.