Click here to Skip to main content
15,894,223 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to retrieve data from database and show in Checkbox using JSON in MVC Razor view.
And then, I want to save data of checkbox checked to database using JSON in MVC Razor view.
Posted
Comments
CHill60 10-Feb-15 5:50am    
You have our permission to do that. What code have you tried so far?
_Asif_ 10-Feb-15 5:57am    
:)

1 solution

JavaScript
//use this code this will help you to post the data and get the data is call back function, your action method should return the you databse value.

$.ajax({
            type: "POST",
            url: "/contrller/Actionmethod",
            dataType: "json",
            data: { value: seectedvalue }, //oyur chechbox value
            success: function (data) {
                //assign your return data where you wanto here
                });
            },
            error: function (ex) {
                alert('Failed to retrieve values.' + ex);
            },
 });
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900