asp to asp.net conversion

Discussion in 'ASP .Net Security' started by John, Sep 10, 2006.

  1. John

    John Guest

    Hi

    I have a pure asp app which I need to integrate into an asp.net app in terms
    of the asp.net membership/roles/login that asp.net app uses. I understand
    there is no way for a pure asp app to share session etc. with asp.net i.e.
    it can't work with asp.net membership/login. In which case is there a way to
    convert asp app into some sort of psuedo asp.net app to make it work with
    asp.net membership?

    Thanks

    Regards
     
    John, Sep 10, 2006
    #1
    1. Advertising

  2. re:
    > I understand there is no way for a pure asp app to share session etc. with asp.net


    There is...

    See :
    http://msdn.microsoft.com/asp.net/r...library/en-us/dnaspp/html/converttoaspnet.asp




    Juan T. Llibre, asp.net MVP
    aspnetfaq.com : http://www.aspnetfaq.com/
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en espaƱol : http://asp.net.do/foros/
    ===================================
    "John" <> wrote in message news:...
    > Hi
    >
    > I have a pure asp app which I need to integrate into an asp.net app in terms of the asp.net
    > membership/roles/login that asp.net app uses. I understand there is no way for a pure asp app to
    > share session etc. with asp.net i.e. it can't work with asp.net membership/login. In which case is
    > there a way to convert asp app into some sort of psuedo asp.net app to make it work with asp.net
    > membership?
    >
    > Thanks
    >
    > Regards
    >
    >
    >
     
    Juan T. Llibre, Sep 10, 2006
    #2
    1. Advertising

  3. John

    Scott M. Guest

    Well no, not really. You either have ASP.NET code or you don't. You *can*
    have both running in one application and simply persist your data in a
    database, rather than using sessions. Both Classic ASP and ASP.NET can
    access databases.


    "John" <> wrote in message
    news:...
    > Hi
    >
    > I have a pure asp app which I need to integrate into an asp.net app in
    > terms of the asp.net membership/roles/login that asp.net app uses. I
    > understand there is no way for a pure asp app to share session etc. with
    > asp.net i.e. it can't work with asp.net membership/login. In which case is
    > there a way to convert asp app into some sort of psuedo asp.net app to
    > make it work with asp.net membership?
    >
    > Thanks
    >
    > Regards
    >
    >
    >
     
    Scott M., Sep 10, 2006
    #3
  4. John,

    Can you provide more detail on how you expect to use the membership and
    roles features?

    What you can do is mix classic ASP and ASP.NET pages for the same
    website. From there you can provide an ASP.NET login screen and place
    the ASP.NET 2.0 login control on it and configure web.config for how
    the ASP.NET website will function, either Forms or Windows
    authentication as well as what locations are protected.

    >From that point you could use Javascript to send requests from the

    classic pages to the ASP.NET sites to get access to the features which
    you want protected by the membership and roles features. Depending on
    what you need to do this could be easy or very tricky.

    One technique which I have used is to pull a URL with an AJAX request
    for a full ASPX page which has all of the content with comment markers
    placed around the results, such as...

    <!-- RESULTS START -->
    ... results go here ...
    <!-- RESULTS END -->

    For the AJAX reponse, you can parse the responseText with the indexOf
    function. Here is some code to do that...

    var startMarker = "<!-- RESULTS START -->";
    var endMarker = "<!-- RESULTS END -->";
    var startIndex = t.responseText.indexOf(startMarker) +
    startMarker.length;
    var endIndex = t.responseText.indexOf(endMarker);
    var contentBlock = document.getElementById('content');

    if (startIndex != -1) {
    var contentResults = t.responseText.substring(startIndex,
    endIndex);
    contentBlock.innerHTML = contentResults;
    }

    You can then place whatever content the ASP.NET page generated into you
    classic ASP page. The AJAX request will provide the membership
    information with the same cookies as a normal request, so the
    authentication token use for the ASP.NET membership will be available.

    In your case I would also check for a status block because a user may
    not be authenticated or their session may have expired or somehow
    become invalid.

    <!-- STATUS START -->
    OK
    <!-- STATUS END -->

    And check that the page was returned OK, or with access denied based on
    the role.

    Over time you can phase in more and more of the ASP.NET content and
    reduce the classic ASP pages. Just be sure to create these content
    bits as User Controls so it is easy to wrap them in different pages
    based on their use. That will give you a great deal of flexibility.

    Brennan Stehling
    http://brennan.offwhite.net/blog/

    John wrote:
    > Hi
    >
    > I have a pure asp app which I need to integrate into an asp.net app in terms
    > of the asp.net membership/roles/login that asp.net app uses. I understand
    > there is no way for a pure asp app to share session etc. with asp.net i.e.
    > it can't work with asp.net membership/login. In which case is there a way to
    > convert asp app into some sort of psuedo asp.net app to make it work with
    > asp.net membership?
    >
    > Thanks
    >
    > Regards
     
    Brennan Stehling, Sep 11, 2006
    #4
    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. Tony
    Replies:
    0
    Views:
    529
  2. Brian Henry

    Conversion errors from .NET 2.0 ASP.NET...

    Brian Henry, Oct 31, 2005, in forum: ASP .Net
    Replies:
    7
    Views:
    1,796
    Brian Henry
    Nov 1, 2005
  3. =?Utf-8?B?Qm9i?=
    Replies:
    2
    Views:
    404
    =?Utf-8?B?Qm9i?=
    Jan 30, 2006
  4. Bonggoy Cruz
    Replies:
    7
    Views:
    4,017
    =?Utf-8?B?RHVzdGluIHZhbiBkZSBTYW5kZSBbTUNBRF0=?=
    Apr 14, 2006
  5. , India
    Replies:
    2
    Views:
    478
    Fraser Ross
    Sep 15, 2009
Loading...

Share This Page