Welcome Guest Search | Active Topics | Sign In | Register

Editor - Using CSS Styles without a stylesheet file Options
Richard
Posted: Wednesday, May 19, 2010 5:09:16 PM
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?
eo_support
Posted: Wednesday, May 19, 2010 6:01:04 PM
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!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.