This is a migrated thread and some comments may be shown as answers.

Using ScriptManager and StyleSheetManager with Dynamically-generated JS/CSS Content

3 Answers 153 Views
ScriptManager and StyleSheetManager
This is a migrated thread and some comments may be shown as answers.
Kevin Warnke
Top achievements
Rank 1
Kevin Warnke asked on 19 Oct 2011, 08:36 PM
I'm using the ScriptManager and StyleSheetManager controls to combine multiple JS and CSS files into 1 request.  That all works as expected when the JS and CSS files are static content files bundled with the deployment.

However, I would like to start using the same technique to include dynamic JS and CSS content that is generated by the server.  Think of it like including an ASPX page as one of the StyleSheetReference objects (although I tried this and it doesn't work by default).

Does anyone know how to do this?

Thanks,
Kevin

3 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 24 Oct 2011, 11:04 AM
Hello Kevin,

RadScriptManager and RadStyleSheetManager are only able to serve embedded and external web resources (which are both static).

I guess if you are dynamically generating, let say CSS, you can directly render it on the page, so there will not be an additional request. I hope this makes sense.

All the best,
Simon
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Kevin Warnke
Top achievements
Rank 1
answered on 24 Oct 2011, 04:09 PM
That does make sense and is one option.

The CSS/JS does not change from request to request, though.  It would be the same so having it in an externally referenced file that gets cached between requests is the most ideal.

So it sounds like these controls don't have a way to add script/CSS content versus an external (static) file reference that all gets combined.  Is that correct?

Thanks,
Kevin
0
Simon
Telerik team
answered on 27 Oct 2011, 10:08 AM
Hello Kevin,

Yes, that is correct - the controls can serve only embedded or external (files in the project structure) script and CSS files.

Kind regards,
Simon
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
ScriptManager and StyleSheetManager
Asked by
Kevin Warnke
Top achievements
Rank 1
Answers by
Simon
Telerik team
Kevin Warnke
Top achievements
Rank 1
Share this question
or