|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
asp to asp.net conversionHi
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 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/reference/state/default.aspx?pull=/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/ =================================== Show quote "John" <John@nospam.infovis.co.uk> wrote in message news:OuJ1rSO1GHA.4632@TK2MSFTNGP03.phx.gbl... > 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 > > > 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. Show quote "John" <John@nospam.infovis.co.uk> wrote in message news:OuJ1rSO1GHA.4632@TK2MSFTNGP03.phx.gbl... > 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,
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 whichyou 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: Show quote > 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 |
|||||||||||||||||||||||