This is starting to get dangerous…I’m blogging about SharePoint development twice in a row. Again, this may be something very basic to most SharePoint developers, but as I learn, I enjoy blogging about issues I’ve discovered and things I’ve learned as I continue to develop more.
My next venture into SharePoint development is to create some custom .ASPX forms for use within our SharePoint environment. For our situation, InfoPath Forms Services would make much more sense, unfortunately, we only have SharePoint 2007 Standard with no plans to go to Enterprise.
So, I created a very basic .ASPX file with an equally as simple .cs (code behind file), packaged it all up as solution and deployed it. However, when I went to access the site, I encounter a Could Not Load Type… error. After a quick search on Google, I found – http://sharepointben/s.catapultsystems.com/matthew/archive/2007/12/07/could-not-load-type-error.aspx between that post and the post by Andrew Connell that was referenced there I was able to solve my problem.
[Update 4/20/2012] – Recently a couple people have commend that the link above no longer works. For a good walkthrough on creating an application page in SharePoint 2007 please see this page – http://code-journey.com/2009/make-a-sharepoint-application-page-with-codebehind/
When I had created my .aspx file I had failed to use the 5 part name to reference the assembly file. I had put Inherits=NewForm.NewForm rather than Inherits=NewForm.NewForm, NewForm, Version=184.108.40.206, Culture=neutral, PublicKeyToken=*********
As soon as I changed my .aspx file to use the 5 part name and redeployed my solution everything worked perfectly!