Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Custom control to wrap ASP code does not execute.

Status
Not open for further replies.

aimlion11yahoo

Instructor
Jul 20, 2006
42
US
I was using the following method to insert an include file that contained some ASP code. Everything was working fine. The line <%=request.servervariables("SCRIPT_NAME")%> returned the name of the page


Code:
    <body MS_POSITIONING="FlowLayout">
        <!-- #include virtual="includes/i_PageLayout_Top.ASP" -->

I replace the #include statement with the following custom control:


Code:
    <body MS_POSITIONING="FlowLayout">
        <cc1:CBDInclude id="CBDInclude1" FileName='C:\Inetpub\[URL unfurl="true"]wwwroot\Configurator\Includes\i_PageLayout_Top.ASP'[/URL]
            runat="server"></cc1:CBDInclude>
When using the custom control above, the ASP code does not execute.
<%=request.servervariables("SCRIPT_NAME")%> returns "<%=request.servervariables("SCRIPT_NAME")%>", not the name of the page.

Is there something I can do to fix this problem, or should I stick with the #include statement?

Thanks,
 
I'd rewrite whatever functionality is in the include file in ASP.NEt code and then include it on the page by whatever means you want (i.e a user control). Mixing ASP with ASP.NET can cause more problems than it's often worth to just rewrite it.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top