View Full Version : Scriptmanager changes css

Mar 28, 2008, 8:46 AM

When I add the ScriptManager class to the site, my predefined css changes (for example h1, h2, h3, small). I don't want to disable all the css (the controls use it, right?). Is there a way to prevent the css layout from changing?

Mar 28, 2008, 11:46 AM
You can add ScriptContainer in page header before you css styles

Mar 28, 2008, 2:47 PM
Hi kabla,

The stylesheet added by the Coolite/ExtJS controls does override many default css classes. This can certainly cause problems when adding the controls to an existing project. This is something we've discussed with the core ExtJS development team and with some luck will be addressed in a future ExtJS release (v3.0?).

There are a couple ways to attempt to work-around the problem...

As mentioned by Vladimir (vladimir), you can add a ScriptContainer control into the <head> of your Page at the position where you want the Coolite/ExtJS scripts and styles to be injected. If your styles are being overwritten, adding the ScriptContainer before your .css include *should* solve most of the conflicts.


<head runat="server">

<cool:ScriptContainer ID="ScriptContainer1" runat="server" />

<!-- Add your .css here -->

<script type="text/javascript">
// your javascript here
<form id="form1" runat="server">
<cool:ScriptManager ID="ScriptManager1" runat="server" />

Set the RenderStyles property to "None", and then manually add a link to the ext-all.css file as required. The following forum posts outline how/where to set the RenderStyles property.<ul> http://forums.ext.net/showthread.php?postid=177.aspx http://forums.ext.net/showthread.php?postid=178.aspx http://forums.ext.net/showthread.php?postid=11.aspxExample

<cool:ScriptManager RenderStyles="None" ID="ScriptManager1" runat="server" />
[/list]All that said, there still might be some css collisions.

Hope this helps.