- Install the AjaxPro.dll into the GAC or the bin folder (your choice)
- Add the Ajax HTTPHandler to each virtual directory's web.config
<add verb="*" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro, Version=6.7.20.1, Culture=neutral, PublicKeyToken=4735ae9824c7d3ec"></add> - Call the register command
AjaxPro.Utility.RegisterTypeForAjax(typeof(MyPage), this.Page);
- Make a Ajax call with JavaScript
try
{
window.attachEvent("onload", new Function("AjaxUserInfoInit();"));
}
catch(ex)
{
//Do Nothing
}
So after getting everything configured, I tried loading my SharePoint portal and I started getting security errors for AjaxPro. Apparenty the above blog does not have code access security (or just didn't bother to mention it) setup on his server. For my setup, the best way to get the AjaxPro.dll the permissions it needed was to put it in the GAC (not always the safest way to do things). So after trying to load the portal again, I started getting an error saying that it couldn't locate the AjaxPro.dll. So after some googling, I found an article that mentions that if the dll for an HTTPHandler is in the GAC, the full strongnamed assembly name should be used in the HTTPHandler tag instead of just the assembly file name.
Soure: http://www.codeproject.com/aspnet/exploresessionandcache.asp
Once again I'm trying to load the portal and I get an error about how the AjaxPro assembly does not allow partially trusted callers to access it. So I downloaded the source code, compiled it with a strong name, add the AllowPartiallyTrustedCallersAttribute, redeployed the dll, and voila!!! My portal is once again serving Sharepoint sites. Now I can start writing the code to use the AjaxPro.dll.
No comments:
Post a Comment