tags:

views:

90

answers:

2

I am working on creating an MVC application for an existing Bug tracker of sorts, ASP.net Web site.

I am used to passing data in the querysting of a Web site and am not sure how to go about doing that in MVC. I do understand the MVC model and how things work but as a beginner, my thought process is a bit clouded.

Views/Project/Index.aspx - My first page, List of projects

<ul id="ProjectList">
    <% foreach (var item in Model) { %>
        <li><%= Html.ActionLink("Details", "IssueType", new { id=item.ProjectId })%></li>
    <% } %>
</ul>

In my ASP.Net web site, in order to create an Issue for this project, I end up with a url looking like this:

Issue.aspx?pid=3&issuetypeid=6

I go from

Projects.aspx --> IssueTypes.aspx --> Issue.aspx

collecting the projectId and issueTypeId on the way in the querystring.

This enables me to write to the DB knowing the ProjectID and Issue Type ID.

How would something like this be architectured in MVC?

A: 

I suggest going through the Nerd Dinner Asp.Net MVC tutorials if you haven't already. I suggest taking a very RESTful approach to your application - a bug tracking app should fit in with REST quite handily.

By the time you've gone through the Nerd Dinner tutorials, you should have a good grasp on both MVC and REST.

Terry Donaghe
+2  A: 

Nerd Dinner is an excellent starting point and will show you a lot of what is possible and how to go about doing it.

The only other suggestions I might add are to create another smaller application, after Nerd Dinner, for the practice. I did that and discovered better ways to do things which I then employed in my main application.

Also think ASCX as much as possible and learn how to pass data to them. This is such a great time saver later on.

Spend time thinking about the folder structure and the different sections of your application and how to seperate them. Think about security and administration and what is available to users v's admins.

Goto asp.net and take a look at the MVC section there and go through the video tutorials. They're pretty good.

griegs