• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 262
  • Last Modified:

Trying to customize scaffolding in VS2010 VB Web Site

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,
  • 2
1 Solution
prairie1Author Commented:
I found the issue...so 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.
prairie1Author Commented:
I hope my comments can help someone else making the same mistakes...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now