1

I am using ASP.NET MVC 4, and I am trying to do the following:

I have a view where I have some radio buttons and checkboxes. User can select what he wants and then there is a submit button in this view that can be pressed. If this button is pressed I want pass by parameter or some other way the radio buttons and checkboxes state (checked/unchecked) to a controller that is linked to another view. The controller is going to do some tasks by taking into account the radio buttons and checkboxes state. While the controller is doing those tasks, in the view associated with the controller I want to put information about what the controller is doing (the progress - simple sentences describing what it is doing -) and show this view.

The submit button is not within a form and the code for the submit button is:

In onclick button I do not know how to pass the radio buttons and checkboxes state to the controller nor once in the controller I do not know how to show the progress of the tasks doing by the controller in the view linked whith the controller.

I am completely lost.... sorry I am completely new in web application programming... I will highly appreciate is anybody can guide me in the right direction to get rid of this.

Some piece of example would be highly apreciated.

Willy
  • 9,848
  • 22
  • 141
  • 284
  • 1
    You may want to look at using Signal-R ... take a look at this post http://stackoverflow.com/questions/8020204/async-controllers-mvc-long-running-process-with-stops or http://www.hanselman.com/blog/AsynchronousScalableWebApplicationsWithRealtimePersistentLongrunningConnectionsWithSignalR.aspx – Vinod Sep 16 '13 at 15:10
  • Can you show your code? – Raimond Kuipers Sep 16 '13 at 15:11
  • I have no code yet, only the view with the button. The code once button is clicked, I do not know to do this.I have thought another easier approach:to have an UpdatePanel ajax control in the same page where button is. Once button is clicked, lauch a C# method. This method checks what is selected and performs the tasks. When performing tasks, the updatePanel is updated each time a message is printed out to there.I am trying to do this now, but no idea on how to deal with it (i am really a newbie in web application programming), I want to do something very simple. – Willy Sep 16 '13 at 16:48

1 Answers1

1

Thinking about it, it would suggest to define a ViewObject class that matches all the field (radiobuttons, checkboxes etc) in your form. And then create a specific controller for this view.

Raimond Kuipers
  • 1,146
  • 10
  • 18
  • Ok,I think your solution would be the best approach but I am searching for something easier,maybe,when button is clicked,in the same page,popup another window within the same page and print out there the progress or to a container(UpdatePanel ajax control)in the same page.Registering to the onclick event of the button and call a C# page method in a class that prints out the progress.Would be it possible?My task is a short task, for example,the result of a ping to a computer.Output would be:"pinging to IP@..." and then "IP@ reached or not." that's it.Then emerged embeded window would be closed. – Willy Sep 16 '13 at 16:03