Results 1 to 6 of 6

Thread: yet again... include files

Threaded View

  1. #1

    Thread Starter
    Fanatic Member wildcat_2000's Avatar
    Join Date
    Nov 2000
    Location
    Italy
    Posts
    727

    Resolved yet again... include files

    hello all,

    i'm new to .net and trying to migrate asp to asp.net.

    my issue is with include files. i've got an ASP file this way:
    Code:
    <%
    Dim MyVar
    MyVar = "file1.inc"
    %>
    <html>
    <body>
    <!--#include file="<%=MyVar%>"-->
    </body>
    </html>
    file file1.inc is:
    Code:
    <%
    Response.Write "HELLO!"
    %>
    what i want to do:

    1. define the name file1.inc programmatically (like in the ASP.OLD example here above);
    2. make sure the included file CAN RUN some code (like in the ASP.OLD example here above).

    so:

    1.

    i just can't get to have an include file defined programmatically like this in asp.net: using <!--#include file="<%=MyVar%>"--> in asp.net won't do since it interprets the <% as wrong path character (basically, doesn't read it as code).
    i'm trying the
    Code:
    <%@ Register TagPrefix="topMenu" TagName="topMenu" Src="topMenu.ascx" %>
    however apparently i can't define the Src tag on code: if left empty or not an .ascx file it generates errors.

    2.

    M$ suggests the Response.WriteFile method, however this does not allow execution of code, of course!

    what the...? any suggestions? getting crazy on this one.

    cheers and thank to you all,

    wc.
    Last edited by wildcat_2000; Nov 25th, 2004 at 07:06 AM.
    When your car breaks down,
    close all windows and retry

    => please rate all users posts! <=

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width