View Full Version : [CLOSED] Use UI themes in javascript

Nov 16, 2015, 8:51 PM
How can I embed the necessary UI css files if the button I want to set ui: 'success' is created in javascript?

Nov 17, 2015, 11:00 AM
Hi @jchau,

I am not 100% sure I've got the question correctly, but:


<%@ Page Language="C#" %>

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
if (!X.IsAjaxRequest)
string theme = X.ResourceManager.Theme.ToString().ToLowerInvarian t();
string ui = "-success";
string rtl = X.ResourceManager.RTL ? "-rtl" : "";
string pathEmbedded = string.Format("Ext.Net.Build.Ext.Net.uipack.{0}.ext-net-ui{1}{2}-embedded.css", theme, ui, rtl);

X.ResourceManager.RegisterClientStyleInclude(pathE mbedded);

<!DOCTYPE html>

<head runat="server">
<title>Ext.NET v2 Example</title>

Ext.onReady(function () {
Ext.create("Ext.button.Button", {
renderTo: Ext.getBody(),
ui: "success",
text: "Button"
<ext:ResourceManager runat="server" />


I took the registration CSS code from the AbstractComponent's RegisterUIResources.