This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > June 2004 > How to stop replace aspx line at start of file





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author How to stop replace aspx line at start of file
Thomas Scheiderich

2004-06-11, 12:14 pm

I have some templates set up that were set up as .net pages. So the top of
the file is:
****************************************************************************
***
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1"
%>
<html><!-- InstanceBegin template="/Templates/intranet_Main.dwt.aspx"
codeOutsideHTMLIsLocked="false" -->
<head>
****************************************************************************
**********

The problem is I need to make a bunch of my pages .asp pages, but I want the
template to be exactly the same. The first line that sets up the aspx page
is outside of the the "InstanceBegin" section and I would have thought that
anything before it would not be replaced.

The problem is that all the pages I created from the template where I took
out the aspx line, so it would work correctly as an asp page, now has the
aspx line added back in.

The reason I am doing this is that we have about 40 asp pages we want to
make uniform and not have to change to aspx pages just yet.

Is there a way to stop this behavior? It really should not put the line in.
The files are designated as .asp files (ie. default.asp instead of
default.aspx).

Thanks,

Tom.



Thomas Scheiderich

2004-06-11, 7:15 pm

Just to add to the confusion, if I take this line (the page directive out of
one of the child files) and then change anything in the template (which has
this directive), it will add the directive into the file and change the file
type from .asp to .aspx. In my site, I have default.asp open without the
directive. I go in and change the title of the template and my default.asp
changes to .aspx and the page directive shows up.

If I try to put "<!-- TemplateBeginEditable name="PageDirective" -->", I get
a message saying that this doesn't belong in an editable region.

If this is an editable region, why is DW mucking with it when I save the
template. I need to find a way to solve this without actually creating 2
identical templates. This would nullifiy the whole point of setting up
nested templates.

I also tried to put "<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>" at the top of
the page and outside the "Uneditable" regions" as well as outside the <HTML>
tags. But DW just dumps this line puts the .net page directive in place of
it and changes the file to .aspx.

Tom.

"Thomas Scheiderich" <tfs@deltanet.com> wrote in message
news:10cjbqfic2f25fe@corp.supernews.com...
> I have some templates set up that were set up as .net pages. So the top

of
> the file is:
>

****************************************************************************
> ***
> <%@ Page Language="VB" ContentType="text/html"

ResponseEncoding="iso-8859-1"
> %>
> <html><!-- InstanceBegin template="/Templates/intranet_Main.dwt.aspx"
> codeOutsideHTMLIsLocked="false" -->
> <head>
>

****************************************************************************
> **********
>
> The problem is I need to make a bunch of my pages .asp pages, but I want

the
> template to be exactly the same. The first line that sets up the aspx

page
> is outside of the the "InstanceBegin" section and I would have thought

that
> anything before it would not be replaced.
>
> The problem is that all the pages I created from the template where I took
> out the aspx line, so it would work correctly as an asp page, now has the
> aspx line added back in.
>
> The reason I am doing this is that we have about 40 asp pages we want to
> make uniform and not have to change to aspx pages just yet.
>
> Is there a way to stop this behavior? It really should not put the line

in.
> The files are designated as .asp files (ie. default.asp instead of
> default.aspx).
>
> Thanks,
>
> Tom.
>
>
>



Thomas Scheiderich

2004-06-11, 7:15 pm

"Thomas Scheiderich" <tfs@deltanet.com> wrote in message
news:10ck06qperkgofd@corp.supernews.com...
> Just to add to the confusion, if I take this line (the page directive out

of
> one of the child files) and then change anything in the template (which

has
> this directive), it will add the directive into the file and change the

file
> type from .asp to .aspx. In my site, I have default.asp open without the
> directive. I go in and change the title of the template and my

default.asp
> changes to .aspx and the page directive shows up.
>
> If I try to put "<!-- TemplateBeginEditable name="PageDirective" -->", I

get
> a message saying that this doesn't belong in an editable region.
>
> If this is an editable region, why is DW mucking with it when I save the
> template. I need to find a way to solve this without actually creating 2
> identical templates. This would nullifiy the whole point of setting up
> nested templates.
>
> I also tried to put "<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>" at the top

of
> the page and outside the "Uneditable" regions" as well as outside the

<HTML>
> tags. But DW just dumps this line puts the .net page directive in place

of
> it and changes the file to .aspx.
>
> Tom.
>


On more thing I found in Murrys Template book, that you can prevent changes
to code outside the HTML area by adding "<!-- TemplateInfo
codeOutsideHTMLIsLocked="true" -->". This seems to only work, sort of. It
did prevent the change to the page directive, but the file still changed
from default.asp to default.aspx.

Here is the new code:

<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1"
%>
<html>
<head>
<!-- TemplateInfo codeOutsideHTMLIsLocked="true" -->
<!-- TemplateBeginEditable name="doctitle" -->

It was interesting that the non-templates have the
codeOutsideHTMLIsLocked="false". Not sure why it is doing this.

When I think I have solved a problem, another one shows up.

This is driving me crazy.

Tom.
> "Thomas Scheiderich" <tfs@deltanet.com> wrote in message
> news:10cjbqfic2f25fe@corp.supernews.com...
> of
>

****************************************************************************
> ResponseEncoding="iso-8859-1"
>

****************************************************************************
> the
> page
> that
took[color=darkred]
the[color=darkred]
> in.
>
>



Thomas Scheiderich

2004-06-11, 7:15 pm


"Thomas Scheiderich" <tfs@deltanet.com> wrote in message
news:10ck1d7nltcgh4c@corp.supernews.com...
> "Thomas Scheiderich" <tfs@deltanet.com> wrote in message
> news:10ck06qperkgofd@corp.supernews.com...
out[color=darkred]
> of
> has
> file
the[color=darkred]
> default.asp
> get
2[color=darkred]
top[color=darkred]
> of
> <HTML>
> of
>
> On more thing I found in Murrys Template book, that you can prevent

changes
> to code outside the HTML area by adding "<!-- TemplateInfo
> codeOutsideHTMLIsLocked="true" -->". This seems to only work, sort of.

It
> did prevent the change to the page directive, but the file still changed
> from default.asp to default.aspx.
>
> Here is the new code:
>
> <%@ Page Language="VB" ContentType="text/html"

ResponseEncoding="iso-8859-1"
> %>
> <html>
> <head>
> <!-- TemplateInfo codeOutsideHTMLIsLocked="true" -->
> <!-- TemplateBeginEditable name="doctitle" -->
>


Actually, I found that it doesn't matter whether you have this set "true" or
"false", it will still put the .net directive back (no matter what). The
only thing the OutsideHTMLIsLocked seems to do, is prevent you from editing
it from inside DW (if true) or allow you to edit it (if set to false).

I found that it won't change the file extension, if on disk (although, it
will change the Page Directive - which will screw everthing up since you
will now have the wrong Directive for the type of extension you are using
(.asp/.aspx). If you have the file open, it will change the file extension
there and when you save your files, it will save that new extension (and
leave the old one). This should really drive you crazy when you find you
changes not being showing up because you were looking at the wrong extension
when making the changes.

Tom

> It was interesting that the non-templates have the
> codeOutsideHTMLIsLocked="false". Not sure why it is doing this.
>
> When I think I have solved a problem, another one shows up.
>
> This is driving me crazy.
>
> Tom.
top[color=darkred]
>

****************************************************************************
>

****************************************************************************
want[color=darkred]
> took
> the
to[color=darkred]
line[color=darkred]
>
>



Thomas Scheiderich

2004-06-11, 7:15 pm

"Thomas Scheiderich" <tfs@deltanet.com> wrote in message
news:10ck49jq1lfkm67@corp.supernews.com...
>
> "Thomas Scheiderich" <tfs@deltanet.com> wrote in message
> news:10ck1d7nltcgh4c@corp.supernews.com...
> out
(which[color=darkred]
the[color=darkred]
> the
I[color=darkred]
the[color=darkred]
creating[color=darkred]
> 2
up[color=darkred]
> top
place[color=darkred]
> changes
> It
> ResponseEncoding="iso-8859-1"
>
> Actually, I found that it doesn't matter whether you have this set "true"

or
> "false", it will still put the .net directive back (no matter what). The
> only thing the OutsideHTMLIsLocked seems to do, is prevent you from

editing
> it from inside DW (if true) or allow you to edit it (if set to false).
>
> I found that it won't change the file extension, if on disk (although, it
> will change the Page Directive - which will screw everthing up since you
> will now have the wrong Directive for the type of extension you are using
> (.asp/.aspx). If you have the file open, it will change the file

extension
> there and when you save your files, it will save that new extension (and
> leave the old one). This should really drive you crazy when you find you
> changes not being showing up because you were looking at the wrong

extension
> when making the changes.
>
> Tom


I found that if you take the Directive out of the page completely, you get a
message that says this change will not be copied to the other files, unless
you set the OutsideHTMLIsLocked to "true". This is a wrong. It actually
does go to each file (even though it is set to "true") and take the
Directive out.

This is getting ridiculous. I cannot not find a way to handle this
situation that DW specifically says it will handle.

Tom.
>
> top
>

****************************************************************************
template="/Templates/intranet_Main.dwt.aspx"[color=darkred]
>

****************************************************************************
> want
aspx[color=darkred]
thought[color=darkred]
I[color=darkred]
has[color=darkred]
want[color=darkred]
> to
> line
>
>



Sponsored Links


Copyright 2003 - 2009 forum4designers.com  Software forum  Computer Hardware reviews