We help IT Professionals succeed at work.
Get Started

MVC property binding question

soozh asked
Last Modified: 2012-08-20

I am an old Delphi/intraweb programmer that is now project leading an MVC project.

In this project we have an underlying database and some simple forms that are used to modify the database tables.  For example we have a Users Form and a Users table.

In the Users Form its possible to create new, modify and delete users.   We have a set of commands (New, Modify, Save, Delete, Regret) as buttons.  The states of these buttons changes depending on the state of the form.

Its not so complicated.  For example when the user opens the form the New button is enabled, but the others are disabled.  When the user selects an existing record the the Edit button is enabled.  Fairly standard stuff!

In my Delphi days I would connect the command buttons state (enabled or disabled) to the state of the underlying dataset.

So for example when it was empty only the New button was enabled.  And when it contained data then the Modify button would be enabled.  The button states were directly bound to the state of the underlying dataset.

In the MVC application my programs say that they must write some javascript to handle the button states and there must be other server side code to handle the dataset.

My wish is that we use ajax calls for the onClick events of the command buttons so that all of the logic can be placed server side and hopefully the button states can be bound to the dataset.

Is this possible?  Are the any ways of binding visible control properties to dataset status - or any other property for that matter?

Watch Question
This problem has been solved!
Unlock 1 Answer and 1 Comment.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE