html in editor break page

Last post 09-02-2008, 3:43 PM by Adam. 3 replies.
Sort Posts: Previous Next
  •  09-02-2008, 8:36 AM 43431

    html in editor break page

    I have a CE inside a GridView in ASP.net page. when a user adds a text containing invalid table structure, and submit it breaks the entire page structure, since it is all build as a table. I'm using a asp:Label to display the results, maybe another control will work better??? I'm attaching an example for such an invalid taxt:
     
    <p>&nbsp;</p> <div>&nbsp;<br /> <br /> </div> <div style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; padding-top: 2.88pt" v:shape="_x0000_s1027"><span style="font-size: 16pt; font-family: 'Comic Sans MS'; language: EN"><br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <span style="color: #0000ff"><span style="color: #0000ff"><span style="color: #000080"><span style="color: #000080">?</span> </span></span></span></span><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN"><span style="color: #003366"><span style="font-size: 12pt; color: #003366; font-family: 'Comic Sans MS'; language: EN"><span style="color: #000080"><span style="color: #0000ff"><span style="color: #0000ff"><span style="color: #000080"><span style="color: #000080"><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN"><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">Please send an ample amount of nutritious, low sugar snacks for the entire class.</span> </span><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (12 students + 2 teachers)</span> </span></span></span></span> <div>&nbsp;</div> </span></span></span></span><span style="color: #0000ff"><span style="color: #0000ff"><span style="color: #000080"><span style="color: #000080"><span style="font-size: 16pt; font-family: 'Comic Sans MS'; language: EN">?</span><font size="3"><font face="Times New Roman"> </font><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">Plastic (5 oz) cups, napkins and utensils are also needed.&nbsp; You can coordinate the snack with the letter of the week for our class.</span><font face="Times New Roman"> </font></font></span></span></span></span></div> <p style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; padding-top: 2.88pt" v:shape="_x0000_s1027"><span style="color: #000080"><span style="color: #000080"><span style="font-size: 16pt; font-family: 'Comic Sans MS'; language: EN">?</span> <span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">Snack suggestions: Pretzels, fresh fruit, cheese (cubed, sliced or string),&nbsp; crackers, yogurt, raisins, carrots, Jell-O, or vanilla wafers.</span> </span></span></p> <p style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; padding-top: 2.88pt" v:shape="_x0000_s1027"><span style="color: #000080"><span style="color: #000080"><span style="font-size: 16pt; font-family: 'Comic Sans MS'; language: EN">? </span><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">Please send fruit three times a week.&nbsp; Kids love apples, grapes, bananas, strawberries, watermelon.&nbsp; Please have fruit washed and ready to eat.</span> </span></span></p> <p style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; padding-top: 2.88pt" v:shape="_x0000_s1027"><span style="color: #000080"><span style="color: #000080"><span style="font-size: 16pt; font-family: 'Comic Sans MS'; language: EN">?</span> <span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">Please send </span><span style="font-size: 12pt; font-family: 'Comic Sans MS'; text-decoration: underline; language: EN">all</span> <span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">of the snacks on Monday in the blue snack bag.</span> </span></span></p> <p style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; padding-top: 2.88pt" v:shape="_x0000_s1027"><span style="color: #000080"><span style="color: #000080"><span style="font-size: 16pt; font-family: 'Comic Sans MS'; language: EN">?</span> <span style="font-size: 16pt; color: black; font-family: 'Tw Cen MT'; language: EN"><span style="color: #000080"><span style="font-size: 16pt; color: #000080; font-family: 'Tw Cen MT'; language: EN">Please send unopened boxes of snack.</span> </span></span>&nbsp;</span> </span></p> <p style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; padding-top: 2.88pt" v:shape="_x0000_s1027"><span style="font-size: 18pt; font-family: 'Comic Sans MS'; language: EN"><span style="color: #000080"><span style="color: #000080">No peanuts, nuts, peanut butter or popcorn please!</span> </span></span></p> <div dir="ltr" style="padding-top: 1.62pt">&nbsp;</div> <p> <table dir="ltr" style="z-index: 2; left: 26.25pt; width: 474px; position: absolute; top: 0.75pt; border-collapse: collapse; height: 529px" height="502" cellspacing="0" cellpadding="0" width="466" v:shapes="_x0000_s1026"> <tbody> <tr> <td style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; padding-top: 2.88pt; height: 22.85pt" valign="top" height="30"> <p><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">Week of:</span> </p> </td> <td style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; width: 168pt; padding-top: 2.88pt; height: 22.85pt" valign="top" width="224" height="30"> <p>&nbsp;</p> </td> </tr> <tr> <td style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; padding-top: 2.88pt; height: 22.85pt" valign="top" height="30"> <p><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">September 8-12</span> </p> </td> <td style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; width: 168pt; padding-top: 2.88pt; height: 22.85pt" valign="top" width="224" height="30"> <p><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">Avery</span> </p> </td> </tr> <tr> <td style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; padding-top: 2.88pt; height: 26.25pt" valign="top" height="35"> <p><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">September 15-19</span> </p> </td> <td style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; width: 168pt; padding-top: 2.88pt; height: 26.25pt" valign="top" width="224" height="35"> <p><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">Ben</span> </p> </td> </tr> <tr> <td style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; padding-top: 2.88pt; height: 22.85pt" valign="top" height="30"> <p><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">September 22-26</span> </p> </td> <td style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; width: 168pt; padding-top: 2.88pt; height: 22.85pt" valign="top" width="224" height="30"> <p><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">Burke</span> </p> </td> </tr> <tr> <td style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; padding-top: 2.88pt; height: 22.85pt" valign="top" height="30"> <p><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">September 29– Oct 3</span> </p> </td> <td style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; width: 168pt; padding-top: 2.88pt; height: 22.85pt" valign="top" width="224" height="30"> <p><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">Chase</span> </p> </td> </tr> <tr> <td style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; padding-top: 2.88pt; height: 27.55pt" valign="top" height="36"> <p><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">October 6-10</span> </p> </td> <td style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; width: 168pt; padding-top: 2.88pt; height: 27.55pt" valign="top" width="224" height="36"> <p><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">Erin</span> </p> </td> </tr> <tr> <td style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; padding-top: 2.88pt; height: 22.85pt" valign="top" height="30"> <p><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">October 13-16</span> </p> </td> <td style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; width: 168pt; padding-top: 2.88pt; height: 22.85pt" valign="top" width="224" height="30"> <p><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">Frances</span> </p> </td> </tr> <tr> <td style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; padding-top: 2.88pt; height: 22.85pt" valign="top" height="30"> <p><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">October 20-24</span> </p> </td> <td style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; width: 168pt; padding-top: 2.88pt; height: 22.85pt" valign="top" width="224" height="30"> <p><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">Heys</span> </p> </td> </tr> <tr> <td style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; padding-top: 2.88pt; height: 22.85pt" valign="top" height="30"> <p><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">October 27-31</span> </p> </td> <td style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; width: 168pt; padding-top: 2.88pt; height: 22.85pt" valign="top" width="224" height="30"> <p><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">Joseph</span> </p> </td> </tr> <tr> <td style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; padding-top: 2.88pt; height: 26.1pt" valign="top" height="34"> <p><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">November 3-6</span> </p> </td> <td style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; width: 168pt; padding-top: 2.88pt; height: 26.1pt" valign="top" width="224" height="34"> <p><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">Lucy</span> </p> </td> </tr> <tr> <td style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; padding-top: 2.88pt; height: 22.85pt" valign="top" height="30"> <p><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">November 10-14</span> </p> </td> <td style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; width: 168pt; padding-top: 2.88pt; height: 22.85pt" valign="top" width="224" height="30"> <p><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">Michael</span> </p> </td> </tr> <tr> <td style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; padding-top: 2.88pt; height: 22.85pt" valign="top" height="30"> <p><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">November 17-21</span> </p> </td> <td style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; width: 168pt; padding-top: 2.88pt; height: 22.85pt" valign="top" width="224" height="30"> <p><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">Trey</span> </p> </td> </tr> <tr> <td style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; width: 248px; padding-top: 2.88pt; height: 37px" valign="top"> <p><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">November 24 &amp; 25</span> </p> </td> <td style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; width: 168pt; padding-top: 2.88pt" valign="top" width="224"> <p><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">Teacher’s Treat</span> </p> </td> </tr> <tr> <td style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; padding-top: 2.88pt; height: 22.85pt" valign="top" height="30"> <p><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">December 1-5</span> </p> </td> <td style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; width: 168pt; padding-top: 2.88pt; height: 22.85pt" valign="top" width="224" height="30"> <p><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">Zion</span> </p> </td> </tr> <tr> <td style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; padding-top: 2.88pt; height: 22.85pt" valign="top" height="30"> <p><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">December 8-12</span> </p> </td> <td style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; width: 168pt; padding-top: 2.88pt; height: 22.85pt" valign="top" width="224" height="30"> <p><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">Avery</span> </p> </td> </tr> <tr> <td style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; padding-top: 2.88pt; height: 22.85pt" valign="top" height="30"> <p><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">December 15-17</span> </p> </td> <td style="padding-right: 2.88pt; padding-left: 2.88pt; padding-bottom: 2.88pt; width: 168pt; padding-top: 2.88pt; height: 22.85pt" valign="top" width="224" height="30"> <p><span style="font-size: 12pt; font-family: 'Comic Sans MS'; language: EN">Teacher’s Treat</span> </p> </td> </tr> </tbody> </table> </p>
    Filed under:
  •  09-02-2008, 1:03 PM 43439 in reply to 43431

    Re: html in editor break page

    It's better to clean the above HTML code before rendering it into any web page. It looks like the above code is from MS word.

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  09-02-2008, 2:48 PM 43445 in reply to 43439

    Re: html in editor break page

    You might be right, many of our users copy/paste from word into the editor to add a tezt item.
    how would you suggest clean the code? should we instruct the users to do something different?
  •  09-02-2008, 3:43 PM 43446 in reply to 43445

    Re: html in editor break page

    >>how would you suggest clean the code?
     
    Use the following method:

    Editor.CleanUpMicrosoftWordHTML Method 

    Use the Clean Up Word HTML function to remove the extraneous HTML code generated by Microsoft Word.
     
    >>should we instruct the users to do something different?
     
    No.

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View as RSS news feed in XML