I'm not sure where I should post this question and I hope my question comes out clearly enough.
Essentially, I'm in the middle of making an online xml document writer. Essentially, giving users the ability to write postings (forum, or news, etc) in xml and also an associated stylesheet.
The problem is, once the XML document is created, how to maintain it and its associated stylesheet through server post-backs until the user actually clicks "Save to database".
Envision that the user created an XML document online (somehow - details are unclear yet) consisting of:
<div>
<p> this is my first paragraph consisting of ...
<emphasis> BLAHBLAH </emphasis>
continuing on with the paragraph </P>
<image> image of me </image>
</div
Now, I want to provide the user the abilty to modify the style of the various elements. Then the XML Document would be parsed, and all existing tags would be placed in a drop down list. The user can then select from the dropdownlist, any one of the existing tags in the XML document: div, p, emphasis, image. Upon selection of the item, the server will show a div section with the web controls to modify the style, ie. font, font-size, font-color, width, height, text-align, etc.
So, if a user selects the <div> tag, he can adjust certain styles, click "save style", then select another tag, say the <emphasis> tag and adjust other things.
The question is, when the user clicks the "save style", how can I "save" the styles for that particular dropdown selected item?
It seems like I can:
1. use the SQL Server database to temporary store these values, thus persisting these values through post-backs
2. use the dropdownlist, item/value properties and viewstate - for example, <emphasis> would be one item, and the value associated with that item would be "font-color: red; font-size: 20px; ..."
And when I select an item from the dropdownlist, the server would parse the value, and put the values into the web controls reponsible for editing the style, and upon saving the style, it would change the value of the selected item in the dropdownlist.
Any advice would be appreciated, thanks!This is gonna get really complicated very quickly, why dont you look into using a rich text editor such as
http://cutesoft.net/example/general.aspx
theres loads of them on the internet and we use them for our web site using content management. you'll have to look into them. but it allows the user to create the html or rich text.
[to make my response less confusing: this is aimed at the overall solution you are trying to achieve, allowing users to create dynamic content as html through the web page]
From the subject of this post, viewstate is enabled by default for asp.net controls and pages, is there anything I am not aware of ?
regards
0 comments:
Post a Comment