aspx page not inheriting cs class

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

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

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

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 7: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">

 

<

 

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

 

 

 

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.

bvnguyen

 

 




 

 

Nov 20, 2008 at 7:55 PM
Hello.

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=1.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxx" %>

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