This is a work in progress. I will update the documentation as each version is released.

Version 1: How do you have buttons without click events?

This very simple project is similar to something I need to do for work.

In this project, the default view, 'ViewGames' creates a list of a few of my favorite games in an object for the model called 'GameModel'.

The GameModel is a class that contains two properties:

All Games - a list of games
CurrentGame - this is only created on the AddGame view.

There are two things I do not know how to do in MVC, please help me:

1. When the Add Game button is clicked, the list of games is redisplayed and the text box for Add Game is displayed with two buttons: Create, Cancel.

When the 'Create' button is clicked, how do you capture the new value, create a new Game object and add it to the collection of Games stored in the ViewBag?

2. How do you make the Cancel button go back to View Games list?

3. The way MVC wants to display a label bothers me:
MVC tries this:

Name (TextBox)

I want it to be label right aligned plus appended with a colon ("Name:") (TextBox)

@Html.LabelFor(model => model.CurrentGame.Name, htmlAttributes: new { @class = "control-label col-md-2" })

How do I change that line above to display the word Name with a semicolon?

4. The screen appears to do a full post back between the View Games and Add Game screen, is there an Update Panel or some way to refresh the screen without the user seeing the full screen be repainted?

That is all for this version.

If you have a working solution for any or all of the above problems, please email me at corby@datajuggler.com .

Include if you do or do not want credit when I post the result.

Thank you for any help

Last edited Nov 29, 2015 at 5:23 PM by Corby, version 2