
fightclub777
Top achievements
Rank 1
fightclub777
asked on 15 Nov 2007, 06:38 PM
Is it possible to open the editor in the HTML edit mode, but still retain the option to switch to the other edit modes? Thank you.
5 Answers, 1 is accepted
0
Hi fightclub777,
You can achieve this with the following code:
<telerik:radeditor runat="server" id="RadEditor1" onclientload="OnClientLoaded"></telerik:radeditor>
<script type="text/javascript">
function OnClientLoaded(sender, args)
{
sender.set_Mode(Telerik.Web.UI.EditModes.Html);
}
</script>
where you have the following new enumeration:
Telerik.Web.UI.EditModes.prototype =
{
Design : 1,
Html : 2,
Preview : 4,
All : 7
};
Let me know if you have any other questions.
Sincerely yours,
Petya
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
You can achieve this with the following code:
<telerik:radeditor runat="server" id="RadEditor1" onclientload="OnClientLoaded"></telerik:radeditor>
<script type="text/javascript">
function OnClientLoaded(sender, args)
{
sender.set_Mode(Telerik.Web.UI.EditModes.Html);
}
</script>
where you have the following new enumeration:
Telerik.Web.UI.EditModes.prototype =
{
Design : 1,
Html : 2,
Preview : 4,
All : 7
};
Let me know if you have any other questions.
Sincerely yours,
Petya
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0

Gompje
Top achievements
Rank 1
answered on 03 Jan 2008, 04:52 PM
is this possible in the code behind, when creating the editor dynamicly?
(eg. without javascript)
(eg. without javascript)
0
Hello Gompje,
Here is how to implement this feature on the server:
protected void Page_Load(object sender, EventArgs e)
{
RadEditor editor = new RadEditor();
form1.Controls.Add(editor);
editor.OnClientLoad = "OnClientLoad";
string js = @"
<script type='text/javascript'>
function OnClientLoad(sender, args)
{
sender.set_Mode(Telerik.Web.UI.EditModes.Html);
}
</script>";
ClientScript.RegisterStartupScript(this.GetType(), "myscriptkey", js);
}
You can find attached my test page and its codebehind.
Best regards,
Rumen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Here is how to implement this feature on the server:
protected void Page_Load(object sender, EventArgs e)
{
RadEditor editor = new RadEditor();
form1.Controls.Add(editor);
editor.OnClientLoad = "OnClientLoad";
string js = @"
<script type='text/javascript'>
function OnClientLoad(sender, args)
{
sender.set_Mode(Telerik.Web.UI.EditModes.Html);
}
</script>";
ClientScript.RegisterStartupScript(this.GetType(), "myscriptkey", js);
}
You can find attached my test page and its codebehind.
Best regards,
Rumen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0

Frank
Top achievements
Rank 1
answered on 19 Nov 2008, 06:33 PM
Hi, All:
I use RadControls_for_ASP.NET_AJAX_2008_3_1105. This example code seem didn't work, so how to set default to HTML editmode on my version ?
Any advice and suggestion? Thanks a lot.
I use RadControls_for_ASP.NET_AJAX_2008_3_1105. This example code seem didn't work, so how to set default to HTML editmode on my version ?
Any advice and suggestion? Thanks a lot.
1
Hi Frank ,
All you need to do is to change the set_Mode method name with set_mode (lower-case m), e.g.
RadEditor editor = new RadEditor();
form1.Controls.Add(editor);
editor.OnClientLoad = "OnClientLoad";
string js = @"
<script type='text/javascript'>
function OnClientLoad(sender, args)
{
sender.set_mode(Telerik.Web.UI.EditModes.Html);
}
</script>";
ClientScript.RegisterStartupScript(this.GetType(), "myscriptkey", js);
Kind regards,
Rumen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
All you need to do is to change the set_Mode method name with set_mode (lower-case m), e.g.
RadEditor editor = new RadEditor();
form1.Controls.Add(editor);
editor.OnClientLoad = "OnClientLoad";
string js = @"
<script type='text/javascript'>
function OnClientLoad(sender, args)
{
sender.set_mode(Telerik.Web.UI.EditModes.Html);
}
</script>";
ClientScript.RegisterStartupScript(this.GetType(), "myscriptkey", js);
Kind regards,
Rumen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.