We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

how to change default theme

Thread ID:

Created:

Updated:

Platform:

Replies:

130628 May 22,2017 10:13 PM May 24,2017 08:18 AM ASP.NET Core 3
loading
Tags: ColorPicker
afiqdoherty
Asked On May 22, 2017 10:13 PM

hi, I need help on how to change the default theme in my main layout.
For example, the current defaut theme is Flat-Saffron, and I want to set Gradient-Azure as my default theme.
Thanks

Prem Kumar Madhan Raj [Syncfusion]
Replied On May 23, 2017 07:13 AM

Hi Muhammad,   
   
Thanks for contacting Syncfusion support.   
   
We have analyzed the query to “Change the default theme in the mainlayout”. We can achieve this with the following two cases.   
   
Case1: Referring the CSS file (of required theme) initially in layout.cshtml page to render the Control.    
   
Please refer the below code snippet to refer the required CSS file in layout.cshtml page.   
   
    <environment names="Development">   
        <link rel='nofollow' href="~/lib/syncfusion-javascript/Content/ej/web/default-theme/ej.web.all.min.css" rel="stylesheet" />   
        <script src="~/lib/jquery/dist/jquery.js"></script>   
    </environment>   
Here, the control will be rendered with the initial referred theme as specified in layout.cshtml file.    
   
Case2:  Change the theme on Page load   
   
We can dynamically change the theme of the control on page load using a “id” to the CSS being referred initially and change it on page load by using the function shown below.   
   
Set id to the CSS reference.    
   
<environment names="Development">   
        <link rel='nofollow' href="~/lib/syncfusion-javascript/Content/ej/web/default-theme/ej.web.all.min.css" rel="stylesheet" id="mycss" />   
        <script src="~/lib/jquery/dist/jquery.js"></script>   
    </environment>   
   
Please refer the below script in you index.cshtml file to change the theme of the control on page load.   
   
    <script>   
        $(document).ready(function () {   
            $('#mycss[rel=stylesheet]').attr('rel='nofollow' href','http://cdn.syncfusion.com/15.1.0.33/js/web/flat-lime/ej.web.all.min.css');   
        });   
    </script>   
   
Regards,   
Prem Kumar.M  


afiqdoherty
Replied On May 23, 2017 09:06 PM

Thanks Prem for your respond,

I have used Case 1 to solve my problem and it works well :) 

Thanks,

Afiq



Prem Kumar Madhan Raj [Syncfusion]
Replied On May 24, 2017 08:18 AM

Hi Muhammad, 
 
We are glad to hear that the issue has been fixed. 

Please let us know if you need further assistance.  

Regards, 

Prem Kumar.M 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;