Hi,
I am having a very strange problem and I'm not sure what is causing it.
I have built a WSS 3.0 web part that implements a Rad Scheduler (2009.1.527.35). I have implemented custom Object Data Sources exactly as described here: http://www.telerik.com/help/aspnet-ajax/schedule_databindingusingthedatasourceproperty.html
When I deploy the web part, the browser displays a 403 error. To get around this error I can do the following:
1. Open web.config
2. Change something - it can be anything, even just deleting a random character
3. Save the file
4. Site will error out - if I've deleted something important in the web.config
5. Undo changes to web.config - resave
6. Site will come back up and the web part will display
At this point everything will work fine with the scheduler control. All methods in the object data sources will work properly.
If at any time there is an IISRESET run on the server or if I recycle the app pool for this site, the page will go back to the 403 error.
I have narrowed it down to when the object data source is being bound to the scheduler control in my CreateChildControls() method that is causing the issue. I tried moving that code out of the CreateChildControls() and moving it to the RenderWebPart(), but I get a different error, "DataKeyField, DataSubjectField, DataStartField and DataEndField are required for databinding". Which makes sense.
I have also tried to add the object data sources in both OnInit() and CreateChildControls() and the 403 error appears the same for both variations.
From what I can gather, it seems the scheduler control is trying to databind during the CreateChildControls() method and somehow it doesn't have permission to access the object data sources. To ensure it wasn't any custom code in my object data sources, I created a test Select method with no code and bound to that. I had the same problem. Now I also know the 403 is getting thrown before any of my object data source code is actually hit.
I'm not sure if it matters that I am adding the object data sources dynamically to the page or not? Or whether it matters that I am adding those and the scheduler to the page at the same time?
I'm also not sure if I need to add something to my object data source classes to make them accessable from the web part. I tried the AllowPartiallyTrustedCallersAttribute without success.
Here's the setup of my solution:
1. All files are under 1 project - so when I build, I get 1 assembly
2. All classes are using the same namespace (custom)
3. 1 class file that handles the web part code - inherits from Microsoft.SharePoint.WebPartPages.WebPart
4. 1 class file that handles all my custom toolpane options - inherits from Microsoft.SharePoint.WebPartPages.ToolPart
5. All other class files have no inheritance
Another thought I have is that because my custom data source classes have no inheritence to anything in SharePoint, when they are first loaded SharePoint doesn't know they exist under the context? But I did put the proper SafeControl entry in the web.config for the entire namespace (which includes my custom classes). So that one seems unlikely.
I have also followed all the online documentation on adding the telerik customizations to the web.config. I have set my SP trust level to "Full" and I even tried creating a custom CAS file, specifying my DLL. Neither of those solve my problem. My SP site is running under Basic authentication. (I tried integrated, without success)
Has anyone ever tried building a web part using RadScheduler and Object Data Sources? Any ideas or possible solutions to try are appreciated.
Thanks.
I am having a very strange problem and I'm not sure what is causing it.
I have built a WSS 3.0 web part that implements a Rad Scheduler (2009.1.527.35). I have implemented custom Object Data Sources exactly as described here: http://www.telerik.com/help/aspnet-ajax/schedule_databindingusingthedatasourceproperty.html
When I deploy the web part, the browser displays a 403 error. To get around this error I can do the following:
1. Open web.config
2. Change something - it can be anything, even just deleting a random character
3. Save the file
4. Site will error out - if I've deleted something important in the web.config
5. Undo changes to web.config - resave
6. Site will come back up and the web part will display
At this point everything will work fine with the scheduler control. All methods in the object data sources will work properly.
If at any time there is an IISRESET run on the server or if I recycle the app pool for this site, the page will go back to the 403 error.
I have narrowed it down to when the object data source is being bound to the scheduler control in my CreateChildControls() method that is causing the issue. I tried moving that code out of the CreateChildControls() and moving it to the RenderWebPart(), but I get a different error, "DataKeyField, DataSubjectField, DataStartField and DataEndField are required for databinding". Which makes sense.
I have also tried to add the object data sources in both OnInit() and CreateChildControls() and the 403 error appears the same for both variations.
From what I can gather, it seems the scheduler control is trying to databind during the CreateChildControls() method and somehow it doesn't have permission to access the object data sources. To ensure it wasn't any custom code in my object data sources, I created a test Select method with no code and bound to that. I had the same problem. Now I also know the 403 is getting thrown before any of my object data source code is actually hit.
I'm not sure if it matters that I am adding the object data sources dynamically to the page or not? Or whether it matters that I am adding those and the scheduler to the page at the same time?
I'm also not sure if I need to add something to my object data source classes to make them accessable from the web part. I tried the AllowPartiallyTrustedCallersAttribute without success.
Here's the setup of my solution:
1. All files are under 1 project - so when I build, I get 1 assembly
2. All classes are using the same namespace (custom)
3. 1 class file that handles the web part code - inherits from Microsoft.SharePoint.WebPartPages.WebPart
4. 1 class file that handles all my custom toolpane options - inherits from Microsoft.SharePoint.WebPartPages.ToolPart
5. All other class files have no inheritance
Another thought I have is that because my custom data source classes have no inheritence to anything in SharePoint, when they are first loaded SharePoint doesn't know they exist under the context? But I did put the proper SafeControl entry in the web.config for the entire namespace (which includes my custom classes). So that one seems unlikely.
I have also followed all the online documentation on adding the telerik customizations to the web.config. I have set my SP trust level to "Full" and I even tried creating a custom CAS file, specifying my DLL. Neither of those solve my problem. My SP site is running under Basic authentication. (I tried integrated, without success)
Has anyone ever tried building a web part using RadScheduler and Object Data Sources? Any ideas or possible solutions to try are appreciated.
Thanks.