Link to home
Start Free TrialLog in
Avatar of ITsolutionWizard
ITsolutionWizardFlag for United States of America

asked on

mvc, controller, ajax

The codes below is extracted from mvc razor view page / c#.
My question is how to pass pair name/value back  to mvc controller.

Thanks,


<script>
        function Validator() {
            return true;
        }
        function UpdateEventCost() {
            if (Validator() == true) {
                var totalCount = document.getElementById("totalcount").value;
                alert("Success");
                var inputs = document.getElementsByTagName("input");
                for(x=0; x<=inputs.length;x++)
                {
                    var id_name = inputs[x].getAttribute("id");
                    var id_value = document.getElementById(id_name).value;
                }
                //window.location.href = "/Home/MotorhomeEdit/15";
            }
            else {
                alert("Error");
            }
        }
</script>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ITsolutionWizard

ASKER

do we have any ways not using routing?
any helps?
any helps?
do you wish to do a "POST" or "GET" method to your target URL?
ajax post