I am trying to do like this in ASP.net MVC 2.0 Application. I have a form with two fields number1 and number2.
I want add two these two numbers using an ajax reques
Try this,
[HttpPost]
public ActionResult TestAjax(FormCollection form)
{
int strnum1 = Convert.ToInt32(form["txtbox1"].ToString());
int strnum2 = Convert.ToInt32(form["txtbox2"].ToString());
string strnum3 = Convert.ToString(strnum1 + strnum2);
if (strnum3 != null)
{
return "";
}
return JavaScript("JSFunction(paramtr);");
}
View:-
function JSFunction(paramtr)
{
}