I'm trying to use existing aspx page in SharePoint 2010. Page it self depend on some 3rd party classes and I provided source for them and additional assemblies, and project compiles and deploys to sharepoint correctly.

Page is put in layouts directory. Page definition has also a Page directive:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Frameset.aspx.cs" Inherits="Frameset.Test.Source.Frameset.Frameset_Frameset"  %>

File Frameset.aspx.cs is present and project compiles without error. But when I try to access that page, I'm getting following error:

System.Web.HttpException: The file '/_layouts/Frameset.Test/Frameset/Frameset.aspx.cs' does not exist.   

When I change CodeFile to CodeBehind, I'm getting following error:

System.Web.HttpException: Could not load type 'Frameset.Test.Source.Frameset.Frameset_Frameset'.  

Which is strange, because this type (class) is defined in Frameset.aspx.cs, and VS doesn't complain about missing types.


As far as I know, code-behind usage in SharePoint requires you to specify the full assembly name of the assembly that contains the codebehind class (that is - assuming that your assembly is deployed to the gac). Please see if by using the full name your problem is resolved, ie:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Frameset.aspx.cs" 
   Inherits="Frameset.Test.Source.Frameset.Frameset_Frameset, ........, Version=#.#.#.#, Culture=neutral, PublicKeyToken=##########"  %> 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.