Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Working with ASP

I have a site that has the navigation layed out in a template, to give all my html files with the same look and feel.  I have the need for asp pages with that same look and feel.  Therefore I created another template using the .asp extension with the same layout.  When I create the article with the asp code in it, it works fine until i click Normal view.  This rudely rips out the asp code.  Anyway I can prevent that from happening?
Thanks!

JohnnyC
Monday, February 23, 2004

THis is because the normal view uses the microsoft control that needs to see xhtml syntax.  If you contain your asp inside the appropriate xhtml tags that won't happen (CDATA -- I don't know the syntax offhand, but its in the specs).

Its best not to switch to normal view.  Lots of people have learned that the hard way.

I set up a local server on my machine (IIS) which is where I test.  If you can do the same, you will save yourself alot of trouble

joel goldstick
Monday, February 23, 2004

If you stick your ASP code inside a CDATA tag, once the ASP code is parsed, will the browser still render it, or treat it as a comment?

www.MarkTAW.com
Wednesday, February 25, 2004

I think I spoke too soon.  I did some googling.  javascript needs to be "CDATA'd" apparently.  And now that I think about it, that makes sense since the javascript is part of the delivered xhtml.  But the server side scripting shouldn't ever be seen by the browser, so it doesn't make sense to need to put it in CDATA.

I just checked one of my articles with php in it.  I switched  between normal and html mode.  It seemed to handle the php ok, but the closing script tag ?> was turned into ?>

I avoid the problem by never touching normal mode for any pages except strait html.  In that case, I like normal mode because it converts all the tags to lower case!

If you have lots of server script, you can use {$include$} which will solve the problem I think.  OF course if you have script sprinkled in your html that doesn't help.

I like many here have hit the normal button, then html and freaked out a bit.  So, I just never look in normal view.  If the article isn't just (x)html what value is normal view anyway?

joel goldstick
Wednesday, February 25, 2004

*  Recent Topics

*  Fog Creek Home