Page view counter

Dreamweaver templates and ASP.net 2

Last post 09-14-2007 1:21 AM by rooban. 4 replies.

Sort Posts:

  • Dreamweaver templates and ASP.net 2

    01-06-2006, 3:16 PM
    • Loading...
    • gilkesy
    • Joined on 07-01-2004, 4:36 AM
    • Posts 152
    • Points 760
    Hi all

    I'm using Dreamweaver to create the layout and manage my ASP.net 2 site. However, all "code-behind" is done in Visual Studio 2005

    On my ASP.net  pages I need to have a different declaration at the top of each page, e.g.:

    <%@ Page Language="VB" AutoEventWireup="true" CodeFile="annual-travel-insurance.aspx.v
    b" Inherits="travel_insurance_annual_travel_insurance" %>

    <%@ Page Language="VB" AutoEventWireup="true" CodeFile="extended-trip-travel-insurance.aspx.vb" Inherits="travel_insurance_extended_trip_travel_insurance" %>

    It was my understanding that Dreamweaver would leave alone any code outside of the < html > tag However, whenever I update my template, the ASP.net declarations in the pages based on the template are removed by Dreamweaver. This means my pages lose the "link" to their code-behind files. Which is BAD!

    The weird thing is, that if I remove for example the "@" from the declaration (therefore making it an incorrect declaration) then DW leaves the code on the page. What this means is that DW only has problems with  ASP.net declarations. Its quite happy to leave any other text or code.

    What can I do?
  • Re: Dreamweaver templates and ASP.net 2

    01-10-2006, 12:21 PM
    Answer
    • Loading...
    • therookie14
    • Joined on 01-04-2006, 9:23 PM
    • Posts 43
    • Points 225

    add this simple script at the end of the ASP.NET code on top of your child pages:

    <script runat="server">
    </script>

    ex:

    <%@ Register TagPrefix="uc1" TagName="_BreadCrumbs" Src="_BreadCrumbs.ascx" %>
    <%@ Page Language="vb" AutoEventWireup="false" Codebehind="../Default.aspx.vb" Inherits="company.websitename.Web.DefaultPage"%>
    <%@ Register TagPrefix="uc2" TagName="Header" Src="_Header.ascx" %>
    <%@ Register TagPrefix="uc1" TagName="Menu" Src="_Menu.ascx" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <title>websitename- Home</title>
    <script runat="server">
    </script>

    Then DW wont edit it. If you have vs 2005, I would highly recommend you use master pages... although you cant really nest those too effectively. DW templates leave a lot to be desired...

    hope i helped!

  • Re: Dreamweaver templates and ASP.net 2

    08-31-2007, 3:20 AM
    Answer
    • Loading...
    • rooban
    • Joined on 08-31-2007, 3:02 AM
    • Srilanka
    • Posts 2
    • Points 14

    Insert this code <%--'comment--%> after your  <%@ Page Language="VB" AutoEventWireup="true" CodeFile="extended-trip-travel-insurance.aspx.vb" Inherits="travel_insurance_extended_trip_travel_insurance" %>

    like this  

    <%@ Page Language="VB" AutoEventWireup="true" CodeFile="extended-trip-travel-insurance.aspx.vb" Inherits="travel_insurance_extended_trip_travel_insurance" %>

    <%--'comment--%> 

     insert <%--'comment--%>  code inside your template page as well

     
    like this

    <%@ Page Language="VB" ContentType="text/html" ResponseEncoding="utf-8" %>
    <%--'comment--%>

     
    it will work fine

    Regards,
    Rooban
     

    Rooban
    Web & Graphic Designer
    www.inboxdesigns.com
  • Re: Dreamweaver templates and ASP.net 2

    09-14-2007, 12:41 AM
    • Loading...
    • Scott Pulliam
    • Joined on 09-14-2007, 4:38 AM
    • Arlington, TX
    • Posts 1
    • Points 2

    This worked like a charm. 

    But, why did it work???

    TIA,

    Scott

    Thanks,
    Scott P
  • Re: Dreamweaver templates and ASP.net 2

    09-14-2007, 1:21 AM
    • Loading...
    • rooban
    • Joined on 08-31-2007, 3:02 AM
    • Srilanka
    • Posts 2
    • Points 14

    Thats how its works if you are using dreamweaver and .net,

    otherwise you have to go with fully .net compatible software such as expression web

    its working with master pages  

    Rooban

    www.inboxdesigns.com
     

    Rooban
    Web & Graphic Designer
    www.inboxdesigns.com
Page 1 of 1 (5 items)