Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

ASP.NET page directive STILL being overwritten in CS4?

New Here ,
Dec 17, 2008 Dec 17, 2008
I've just downloaded the Studio CS4 trial and was considering upgrading from CS2/Studio 8, which I've been using for 2-3 years. I was hoping this would fix the issue I've been having with Dreamweaver 8 overwriting my ASP.NET page directives from this...
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="login.aspx.vb" Inherits="login" %>
to this...
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %>

I've followed the directions in this technote, which seems to be the solution I'm after...
http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_16531

It does not work. It's still happening in CS4. codeOutsideHTMLIsLocked is set to true when I update the template, but the page directive above is still overwritten. Is this really a bug that's been around for 3 versions, or am I missing something?
TOPICS
Server side applications
864
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 28, 2009 May 28, 2009

I ran into this problem. I have lots of course pages that pull data from a database using ASP.NET. I have a aspx template file that's used to update all the course pages. Each time I'd change the template, it modified the code outside of the <html> tag.

The solution was to add a comment in the content pages as in -

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="course_111.aspx.cs" Inherits="Kayak.Pages.course_111" %>
<%–’comment–%>

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">

...

My template has -

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="course.aspx.cs" Inherits="Kayak.Pages.course" %>

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">

no comment in the template.

The codeOutsideHTMLIsLocked isn't changed from the default "false".

Now updating the template will update all course pages and not touch the code outside the <html> tags.

Found this at http://websitebuildersresource.com/2008/11/28/195/. This post said that this was a known issue but I couldn't find the article mentioned.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 28, 2009 May 28, 2009

Slight change to my last post -

If I include the comment in the template, that gets added to a newly created page. Subsequent updates to template will not change the content page because the comment is there.

It works for me...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 23, 2009 Jun 23, 2009
LATEST

You can place your @code in the head editable region, i.e.:

<!-- InstanceBeginEditable name="head" -->

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="form.aspx.cs" Inherits="fr_form" %>

<!-- InstanceEndEditable -->

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines