error BC30456

Leave a comment

I was building a website using Visual Studio 2008 and everything would build fine. It also published with no problems, however I kept on getting errors when visiting some of the pages. I ended up finding the answer on an old message post that saved me a lot of headaches. The guy who posted it didn’t write English very well, so I’ll give a more detailed example and explain how the fix worked for me.

This may happen when you make a copy of a page and then leave the class the same as the page that you originally copied. Heres more detail:

The error message i was getting:

BC30456: ‘Title’ is not a member of ‘ASP…

BC30456: ‘InitializeCulture’ is not a member of ‘ASP…

This might occur if the “inherits” at the top of your ASPX page doesn’t match your codebehind class. so for instance, I had a page called TermsCodeLookup.aspx, and I needed to modify it a bit for someone, so instead of recreating it, I copied the codebehind to a new page using the name  TermsCodeLookupNew.aspx:

in my TermsCodeLookupNew.aspx page:

<%@ Page Language=”VB” MasterPageFile=”~/master1.master” AutoEventWireup=”false” CodeFile=”TermsCodeLookupNew.aspx.vb” Inherits=”MemberPages_AR_TermsCodeLookup” title=”Untitled Page” %>

and in my TermsCodeLookupNew.aspx.vb code I had:

Partial Class MemberPages_AR_TermsCodeLookup
Inherits System.Web.UI.Page

If you look at the code above in the aspx file, I still had inherits= pointing to the original termscodelookup.aspx page that i had created instead of the TermsCodeLookupNew.aspx page.   And in the codebehind .vb file the partial class was named after the old termscodelookup page instead of termscodelookupnew.

it was an easy fix by just modifying the two like so:

<%@ Page Language=”VB” MasterPageFile=”~/master1.master” AutoEventWireup=”false” CodeFile=”TermsCodeLookupNew.aspx.vb” Inherits=”MemberPages_AR_TermsCodeLookupNew” title=”Untitled Page” %>

Partial Class MemberPages_AR_TermsCodeLookupNew
Inherits System.Web.UI.Page

Hope this helps someone like it did for me.  I’ll give props to the original poster and website here.  another way to fix this is to uncheck the box “Allow this precompiled site to be updateable”

UPDATE: Another area where this can occur is when you get this error and everything looks correct  in your pages and the inherits matches the codebehind class.  The reason this may not work is that the class name may reside in another webpage that you may have copied, and forgot about or never used to begin with.  Just do a solution-wide search  in visual studio of the class name of the page that you are getting the error on. Chances are it will find it in some long-forgotten page, or maybe a copy you made of a page in which you wanted to keep the original just in case.

Partial Class MemberPages_AR_TermsCodeLookup
Inherits System.Web.UI.Page

Dropdownlist Tooltips

Leave a comment

Today i was writing a program, and I ran into a problem where I had DropDownLists drawing data from the database, but the text was really long, thus making the DDL’s stretch halfway accross the page.  After doing a little searching I was able to simply solve it by adding a little code.

Basically what this does is:  in the pre_render section of the dropdownlist control, you

1. Add the “title” attribute to each list item (regardless of size), this way they all have tooltips

2. Scroll through the list items to see how many characters we have

3. If they’re greater than 95, grab the left 95 characters of text, add an elipses

Protected Sub ddlProgramSession6_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlProgramSession6.PreRender

For Each li In ddlProgramSession6.Items

li.Attributes.Add(“title”, li.Text)
If li.Text.Length > 95 Then
Dim strTemp As String
strTemp = Left(li.Text, 95) & “…”
li.Text = strTemp
End If

End Sub

This was an easy way to solve this problem.  Maybe in the future I’ll try to make the elipses into a hyperlink so it’s more intuitive to the user that there is more text.

Newer Entries