switching from normal mode to html mode has side effects

  •  12-22-2005, 5:48 PM

    switching from normal mode to html mode has side effects

    Switching from normal mode to html mode has side effects, but good ones.
     
    For example, I have a snippet that, in normal mode,  inserts an image without height or width attributes:  <img src=a.jpg>
     
    If I switch to html mode, it becomes something like <img src=a.jpg height=12 width=20>
     
    I am pleased with the insertion of size attributes, but it happens only when a user switches modes. And obviously if html mode is disabled, it never happens.
     
    There are plenty of things that happen when switching to html mode. These must be forced weather switching modes or not; the output must not depend on weather the user took a peek at the html!

    Whatever code is executed to change the html when switching modes must be run before the onload event on a postback, weather on the client or the server.
     
View Complete Thread