views:

42

answers:

1

i am new to aspnet mvc, and I have just completed the nerddinner tutorial.

What I am wonting to do is have it so the user would land on the home page, the home page should show five professions, painters, builders, electricians, plasters and roofers.

Then I wont those five categories to be links, and when you click them, they take you to a sub group that shows every company with in that category, so id I clicked on builders, it would take me to a page that shows all tradesmen that are builders.

Thanks.

A: 

For each profession on your home view, you'd generate a link like this:

<% For Each profession In Model %>
  <%=Html.ActionLink("Index", "Profession", profession.ID) %>
<% Next %>

This link will take you to the Index view of the Profession controller. Your profession controller would then obviously take in the ID of the profession and render the view of the list of the sub group.

Brandon Montgomery
Im sorry, what you showed looks good, but Im a complete noob, and I have no idea how to implement what you just typed into my app?
codie
Brandon gave a reasonable guess about what type of code you would be looking for. We can only give generalities unless you are more specific about what you are having trouble with.
Jace Rhea
codie, if you've gone through the NerdDinner tutorial (I have), you should be familiar with models, views, and controllers. I think you might want to run through the tutorial again, but try to do some pieces without the tutorial's help. Hopefully then you will start to grasp what MVC is.
Brandon Montgomery