So I have this javascript as my call:
$("#addNewThankYou").click(function () {
var thankYouNote = $("#thankYouNote").html();
var name = $("#enteredName").html();
$.getJSON("/Home/AddEntryToDatabase", { Name: name, ThankYouNote: thankYouNote }, function (data) {
...
});
});
The C# method behind is pretty standard:
public ActionResult AddEntryToDatabase(String Name, String ThankYouNote){
...
}
My problem lies potentially in the length of the string being passed in. For example, if I pass in a name and a note that are small (< 100 characters) I dont have any issues, it fires the method just fine. However, if I have a note that is pretty long, it doesn't fire the method at all; when I click the button that calls the addNewThankYou.click is doesnt do anything. I tried putting a breakpoint on the first line of the method that gets called, and it doesn't go in at all.
So, my question is this. Is there a limit to the string size that I can pass through the getJSON jQuery method? If so, any suggestions on how to get around this? I dont want to limit these thank you notes to 100 characters!