Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Changing DIV value using jquery MVC

Changing DIV value using jquery MVC

Guest post 
I have one div division


i am Changing value of "myvalue" with jquery 
how can i pass myvalue to my controller.

create a controller get the value by $("#myname").text(); 
and pass it into the controller like this 

for example this is my controller 

    public void UpdateTask(TaskModel tmdl)
        sDBSEntities dbOBj = new sDBSEntities();
        Task tObj = dbOBj.Tasks.Single(x => x.ID == tmdl.ID);
        tObj.Name = tmdl.Name;
        tObj.Description = tmdl.Description;
        tObj.DateUpdated = DateTime.Now;

my ajax call would be

vartmdl = {
ID: $("#hdnId").val(),
Name: $("#txtName").val(),
Description: $("#txtDesc").val()
type: 'POST',
url: '/Task/UpdateTask',
data: tmdl,
cache: false,
success: function (result) {
alert("Updated Successfully");
error: function () {

Users Please post your solution too.

This post first appeared on Asp.netSourceCodes, please read the originial post: here

Share the post

Changing DIV value using jquery MVC


Subscribe to Asp.netsourcecodes

Get updates delivered right to your inbox!

Thank you for your subscription