Welcome to WebmasterWorld Guest from 54.242.115.55

Forum Moderators: ocean10000

Message Too Old, No Replies

Master page won't find code behind

     
3:30 pm on Jul 31, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 10, 2008
posts: 1130
votes: 0


So far I have been avoiding this problem by placing my code in <scripty runat="server"></script> tags but it's bothering me and I want to know why my projects act this way. Every time I create master pages and put aspx controls in them everything is hunkey dorey. Now as soon as I double click in the form to go to the code behind page I get this error.

Server Error in '/' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load type 'ClickableCommunity.ClickableCommunity'.

Source Error:

Line 1: <%@ Master Language="VB" AutoEventWireup="false" CodeBehind="ClickableCommunity.master.vb"
Line 2: Inherits="ClickableCommunity.ClickableCommunity" %>
Line 3:

This is what the start of the vb file looks like

Imports System.Data
Imports System.Data.Sql
Imports System.Data.SqlClient

Partial Public Class ClickableCommunity
Inherits System.Web.UI.MasterPage

Why will my master page never see that? Thanks,

4:14 pm on July 31, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 1, 2005
posts:732
votes: 0


hmmmm strange, I've never seen this before, could you try the following?

change
Inherits="ClickableCommunity.ClickableCommunity"
to
Inherits="ClickableCommunity"

4:17 pm on July 31, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 1, 2005
posts:732
votes: 0


Also, I think CodeBehind="ClickableCommunity.master.vb" should be CodeFile="ClickableCommunity.master.vb". Did you create this file in Visual Studio? (which version)
5:08 pm on July 31, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 10, 2008
posts: 1130
votes: 0


Marcel, thanks for the reply. I already tried your first suggestion and it just says it can't find clickable community. If I change it to codefile it gives me the same error. I created it in VS 2008 I'm beginning to think it is my install of VS.
6:43 pm on July 31, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 10, 2008
posts: 1130
votes: 0


Ok so I was wrong on the codefile thing. It gives me a different error. I realized I was looking at the wrong page after I made that change now it is putting a 1 on the end of the inherits even though it is not there

Server Error in '/' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: ASPNET: Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl).

Source Error:

Line 1: Public Partial Class test1
Line 2: Inherits System.Web.UI.Page
Line 3:

and here is my vb code behind :note I changed to a test masterpage
Imports System.Data
Imports System.Data.Sql
Imports System.Data.SqlClient
Partial Public Class test
Inherits System.Web.UI.MasterPage

Any Ideas?

11:31 pm on July 31, 2009 (gmt 0)

Administrator

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month

joined:Jan 14, 2004
posts:864
votes: 3


I am guessing there might of been another class named "test" so it added the one so that it would be unique.

I see items like that all the time in testing projects where I add test files to test something were all the names are test something.