I have been building a custom module which uses the AJAX.NET dll (available through: http://ajax.schwarz-interactive.de/csharpsample/default.aspx)
I have it working very well for ROOT portals, but for some reason it is breaking on CHILD Portals??
Here's what I've done to make it work:
In web.config I had to add the httpHanlder:
<add verb="POST,GET" path="controls/*.ashx" type="Ajax.PageHandlerFactory, Ajax" />
I used the path "controls/*.ashx" to get around DNNs URL Rewriting. Using this path, DNN doesn't try to re-write the URL. (By the way if you've been having problems getting AJAX.NET work work because of URL re-writing, try this method).
Then, in my ASCX, I added the following to lines to the Page_Load to get the AJAX references:
Ajax.Utility.HandlerPath = "controls" 'Again to get around the URL rewrite, it has to match the "path" in web.config.
Ajax.Utility.RegisterTypeForAjax(GetType(AJAXMethods))
This works REALLY well on the PARENT portal. The module utilizes AJAX and everything works great!
However, when I add the module to a CHILD portal, this is what happens:
1. User logs into child portal.
2. User opens page with module.
3. Module works fine
4. User tries to navigate to another page on the CHILD portal, and DNN asks for user to login again!
Interestingly, if the user exists in BOTH the PARENT and CHILD portals, this problem does not occur. The user can navigate to any pages and back without being prompted to login again.
I used "Fiddler" (available from Microsoft) to analyze the HTTP traffic. Here's what I found.
When the user exists ONLY on the child portal, the cookies "portalaliasid" and "portalroles" get zeroed out when a call is made to the ajax wrapper (/controls/common.ashx). However, if the user exists on the parent portal, the "portalaliasid" and "portalroles" stay intact?????
It seems like DNN is somehow interpreting the calls to the AJAX wrapper as an attempt to access the PARENT portal, and it is running a "signout" or something. It is the equivalent of logging into a CHILD portal, and then trying to navigate to the homepage of the PARENT portal. DNN will automatically signout the user, and if the user tries to go back to the CHILD portal, they must login again. However, with the AJAX wrapper, But, I can't figure out where it's happening with the AJAX hander?.... Anyone know where I can start looking to figure out why this is happening?
Thanks.
-- Will G.