Rank: Newbie Groups: Member
Joined: 1/26/2010 Posts: 3
|
I am trying to use the HTML Editor and I was wondering if its possible to use and apply styles to text content without loading them from a CSS file.
For example, if I had my css classes stored in a database, including the style name and definition, is there anyway to add them to the HTML Editor for content editing directly through some sort of CSS Class collection or something like that?
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
What you can do is to implement a HTTP Handler and then pull your CSS from your DB from that handler. From the Editor's point of view, it still loads a "CSS file", except that CSS file is dynamically generated from your handler (so it has an .ashx extension instead of a .css extension).
If you don't want to use a Http Handler, you can even use an .aspx file. Just create a new Web Form, say CssFromDB.aspx, you would then add code inside the form's Page_Load to call Response.Clear, Response.Write and Response.ContentType to pull the CSS from your DB and render to the client. Once that is done, you can set the Editor's TextAreaCssFile to "CssFromDB.aspx".
Thanks!
|