aspx page not inheriting cs class

Nov 12, 2008 at 10:01 AM
when i am creating a WSpbuilder project and deploying as feature.

<%@ Assembly Name="WSPBuilderProject1, Version=, Culture=neutral, PublicKeyToken=b7052d693c329069" %>

<%@ Page Language="C#" MasterPageFile="~/_layouts/application.master" Inherits="WSPBuilderProject1.FeatureCode.Login" %>
<asp:Content ID="main" runat="server" ContentPlaceHolderID="PlaceHolderMain">
            <td><asp:Label runat="server" ID="lblUsername" Text="Username"/></td>
            <td><asp:TextBox runat="server" ID="txtUsername" /></td>
            <td><asp:Label runat="server" ID="lblPassword" text="Password" /></td>
            <td><asp:TextBox runat="server" ID="txtPassword" /></td>
            <td><asp:Button runat="server" ID="btnLogin" Text="Login" CausesValidation="true" /></td>
            <td><asp:Button runat="server" ID="btnReset" Text="Reset" /></td>
            <td><asp:RequiredFieldValidator runat="server" id="reqLogin" ControlToValidate="txtUsername" ErrorMessage="username mandatory" /> </td>

it is deploying sucessfully.but when using page on sharepoint site..not able to link it with cs class..actually not inheriting class.

Nov 12, 2008 at 6:14 PM

Hi there;

I assume that the deployment put your WSPBuilderProject1 assembly in the GAC and registered it as a safecontrol. I think I had the similar problem, I had to change the web.config to include all dependencies into the assemblies element.  Have you added this element to web.config 
<globalization fileEncoding="utf-8" />




compilation batch="false" debug="true">




add assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
add assembly="WSPBuilderProject1, Version=, culture=neutral, PublicKeyToken=b7052d693c329069" />
    <!-- and others if your project references to them -->




I am looking into the way to add this part into the web.config by changing the solution deployment but haven't found a solution yet.  I have to do it manually after deployment wsp, it is a pain and unacceptable for production release.

Please let me know if this works for you.






Nov 20, 2008 at 6:55 PM

I had the same.  In addition to the changes above, I think your problem is in the Inherits property within the <%@Page tag.  You look to be missing some information.  It should look something like this:

<%@ Page Language="C#" MasterPageFile="~/_layouts/application.master" AutoEventWireup="true" Inherits="WSPBuilderProject1.FeatureCode.Login, WSPBuilderProject1, Version=, Culture=neutral, PublicKeyToken=xxxxxxxxxx" %>

I would also alter your config file within your development environment and