What I want is to pass the value of txtComments from View (using jquery/ajax) to Controller.
The problem is the ajax/jquery doesn\'t accept script tags as string. M
Here's an alternative way to do the same call. And your type should always be in CAPS, eg. type:"GET" / type:"POST".
$.ajax({
url:/ControllerName/ActionName,
data: "id=" + Id + "¶m2=" + param2,
type: "GET",
success: function(data){
// code here
},
error: function(passParams){
// code here
}
});
Another alternative will be to use the data-ajax on a link.
Click Me!
Assuming u had a div with the I'd _content, this will call the action and replace the content inside that div with the data returned from that action.
Not really a direct answer to ur question but its some info u should be aware of ;).