This project is read-only.

How can you have buttons without click events

Rating: No reviews yet
Downloads: 72
Released: Nov 29, 2015
Updated: Nov 29, 2015 by Corby
Dev status: Stable Help Icon

Recommended Download

Source Code LearnMVC_Version1
source code, 15406K, uploaded Nov 29, 2015 - 72 downloads

Release Notes

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 four 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, 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

Reviews for this release

No reviews yet for this release.