Trying to customize scaffolding in VS2010 VB Web Site

Posted on 2011-10-22
Last Modified: 2012-05-12
Hi all,
I'm going through the motions of putting together a (VB) ASP.Net Web Site (not Application) using Dynamic Data template.
The good news, it works out of the box.
The bad news, in the literature I'm reading about customizing the tables by building partial classes--that part is not working.

The problem seems to be that I can't see the 'real' classes that supposedly were built.  So I have a Master table (which MS ever so cutely decides to pluralize to Masters, which doesn't make sense but whatever) and there is no Master.vb or Masters.vb that I can find.  I created my own partial class, using the metadatatype and scaffolding attributes exactly as described in both the book I'm using and various websites with examples.  

I tried naming the partial class both "Master" and "Masters" (thanks for the confusion, MS) maybe I should try "MyMasters"?  Anyway...

If I set the global scaffolding thing to false, I just get the (expected) error that there are no tables to create, if I set it to True, I get the data just fine, but my Partial class changes are totally ignored.

So I guess the main question is, where is the main class for the "Master" table (or Masters)?  I had to add the App_Code folder manually, which I thought was odd (isn't that a pretty standard folder?).  I refreshed,
Thanks for any help,
Question by:prairie1

    Accepted Solution

    I found the anyone stumbling upon this with a similar issue can learn from my mistakes:

    First, I created the partial class but neglected to wrap the class in the Namespace of the data model.

    Second, the examples I read lead me to believe that individual class files were created by for each table--instead, all these partial classes are in the data model's Designer.vb file.

    Third, fieldnames are CASE SENSITIVE??!!  I don't know if there's an option to undo that, but the fields I was trying to hide in my partial class were not in the correct case and there is NO intellisense for this (how spoiled I've become!) and no compile time  error either, the case thing was buried in one of those several page ASP.Net error messages.

    So...all good.

    Author Closing Comment

    I hope my comments can help someone else making the same mistakes...

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
    Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now