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/