Click here to Skip to main content
15,909,445 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

I'm making the following call in my mvc view:-

JavaScript
$.get("/someController/strMethod",{ inStr: userInput }, function (data) {
$("#rData").html(data);
textbox.textContent=data;
}


C#
//controller method
public string strMethod(String inStr){
//manipulation
return inStr
}


This fails when userInput becomes too long and I run into the "Request URL Too Long" error. Do you have any suggestions on how i can work around this?

Thanks
Posted

1 solution

$.get is going to append the parameter data into the url.
Url length is limited and hence you get the error.

Try $.post.
 
Share this answer
 
Comments
Bazalgette 5-Nov-13 22:29pm    
thanks, that worked perfectly!

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