ASP.NET 3.5 and above only

Obout.Ajax.UI Controls - HTML Editor - Set default font in client-side

This example demonstrates how to set the defaultFontFamily and defaultFontSize properties of the Obout.Ajax.UI.HTMLEditor.EditPanel component.

Aa

Font family:    Font size:
ASP.NET
<%@ Register Assembly="Obout.Ajax.UI" Namespace="Obout.Ajax.UI.HTMLEditor" TagPrefix="obout" %>
<obout:Editor runat="server" Id="editor" Width="100%" >
<TopToolbar Appearance="Lite" PreservePlace="true" />
<EditPanel Height="200px" />
</obout:Editor><br />
Font family:
<select onchange="setFontFamily(this.options.item(this.selectedIndex).value)">
<option value=""><default></option>
<option value="arial">Arial</option>
<option value="tahoma">Tahoma</option>
<option value="courier new">Courier new</option>
<option value="georgia">Georgia</option>
</select>
Font size:
<select onchange="setFontSize(this.options.item(this.selectedIndex).value)">
<option value=""><default></option>
<option value="6pt">6pt</option>
<option value="8pt">8pt</option>
<option value="12pt">12pt</option>
<option value="14pt">14pt</option>
</select>
...
<script type="text/javascript">
function setFontSize(value) {
  var editPanel = $find("<%= editor.ClientID %>").get_editPanel();
  editPanel.set_defaultFontSize(value);
}
function setFontFamily(value) {
  var editPanel = $find("<%= editor.ClientID %>").get_editPanel();
  editPanel.set_defaultFontFamily(value);
}
</script>

"These controls are working great for us. And our customer loves them. We are creating new programs all the time. So having great support to us is very important. Thanks for your help."

Jeremy Zimmerman
BAE Systems

Random testimonial   All testimonials