How to make Visual Studio 2005 to handle .asp files like .aspx

Discussion in 'ASP .Net' started by Faustino Dina, Feb 26, 2009.

  1. Hi all,

    I'm porting some old ASP code to ASP.NET. The problem I need to service a
    request to an x.asp script that was originally developed in ASP VBScript
    code. I need the new C# ASP.NET code to be inside x.asp. And I need this to
    be debugged from Visual Studio 2005.
    To do that I followed http://support.microsoft.com/kb/815172 to configure
    IIS to map .asp to be processed by using .NET dll, and also modified the
    web.config in my Visual Studio 2005 project by adding

    <httpHandlers>
    <add verb="GET, HEAD, POST, DEBUG" path="*.asp"
    type="System.Web.UI.PageHandlerFactory"/>
    </httpHandlers>
    But now on the x.asp script:

    <%
    //'dim id
    //'session.Contents.RemoveAll()
    Response.AddHeader("Pragma", "no-cache");
    Response.AddHeader("cache-control","private");
    Response.CacheControl = "no-cache";
    session("giro")=Request.QueryString("gr");
    response.write("&giro="&session("giro"));
    %>

    When it is called from the client, the iis server logs an 500 error. I put a
    breakpoint in the code but it is not honored. Even I can not get a
    compilation error from this file. I think Visual Studio does not recognizes
    the association made in iis that .asp is now an alias of .aspx

    What should I do work with the .asp files like .aspx in Visual Studio 2005?

    Any hint is welcomed

    Thanks in advance

    Sammy
     
    Faustino Dina, Feb 26, 2009
    #1
    1. Advertising

  2. Well, from this source
    (http://dotnetlog.com/archive/2007/10/15/using-non-asp.net-file-extensions-with-asp.net.aspx)
    I borrowed a few new lines for the web.config.
    <buildProviders>

    <add extension=".asp" type="System.Web.Compilation.PageBuildProvider"/>

    </buildProviders>



    This should be put inside <compilation > tag.



    Now, when I run the project from inside VS, I receive compilation errors...
    in the Event Viewer! At least it is a step forward. VS continues to ignore
    the .asp source code despite I registered extension .asp to use C# in
    Tools - Options - Text Editor - File Extension .



    What am I missing?

    Thanks in advance

    Sammy

    "Faustino Dina" <> escribió en el mensaje
    news:ecX%...
    > Hi all,
    >
    > I'm porting some old ASP code to ASP.NET. The problem I need to service a
    > request to an x.asp script that was originally developed in ASP VBScript
    > code. I need the new C# ASP.NET code to be inside x.asp. And I need this
    > to be debugged from Visual Studio 2005.
    > To do that I followed http://support.microsoft.com/kb/815172 to configure
    > IIS to map .asp to be processed by using .NET dll, and also modified the
    > web.config in my Visual Studio 2005 project by adding
    >
    > <httpHandlers>
    > <add verb="GET, HEAD, POST, DEBUG" path="*.asp"
    > type="System.Web.UI.PageHandlerFactory"/>
    > </httpHandlers>
    > But now on the x.asp script:
    >
    > <%
    > //'dim id
    > //'session.Contents.RemoveAll()
    > Response.AddHeader("Pragma", "no-cache");
    > Response.AddHeader("cache-control","private");
    > Response.CacheControl = "no-cache";
    > session("giro")=Request.QueryString("gr");
    > response.write("&giro="&session("giro"));
    > %>
    >
    > When it is called from the client, the iis server logs an 500 error. I put
    > a breakpoint in the code but it is not honored. Even I can not get a
    > compilation error from this file. I think Visual Studio does not
    > recognizes the association made in iis that .asp is now an alias of .aspx
    >
    > What should I do work with the .asp files like .aspx in Visual Studio
    > 2005?
    >
    > Any hint is welcomed
    >
    > Thanks in advance
    >
    > Sammy
    >
    >
     
    Faustino Dina, Feb 26, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ad
    Replies:
    5
    Views:
    1,614
  2. rockdale
    Replies:
    1
    Views:
    667
    Juan T. Llibre
    Aug 23, 2006
  3. Replies:
    1
    Views:
    490
  4. Nathan Sokalski
    Replies:
    1
    Views:
    528
    Nathan Sokalski
    May 15, 2007
  5. Phil Johnson
    Replies:
    9
    Views:
    644
    Phil Johnson
    Jan 31, 2008
Loading...

Share This Page