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>

"Thanks much. The trees seem to be working exactly as we want and we do appreciate the timely resolution. As our project moves further along the design process, we find ourselves utilizing Obout controls more and more and it's comforting to know that your support system is so responsive."

Kevin Holder
Tennessee Department of Human Services

Random testimonial   All testimonials