Archive

Posts Tagged ‘Forms’

Custom SharePoint .ASPX form–“Could Not Load Type”

July 8th, 2010 No comments

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://blogs.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.

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=1.0.0.0, Culture=neutral, PublicKeyToken=*********”

As soon as I changed my .aspx file to use the 5 part name and redeployed my solution everything worked perfectly!