$.ajax({
type:"post"
url:"/text/funtext/1" ///这是默认路由 {controller}/{action}/{id}
success:function(data){
//回传的数据
}
})
//对应方法获取参数
【httppost】
public string funtext(string id)
{
//id就是1
}
-------------------------------------------------------------------------------
$.ajax({
type:"post"
url:"/text/funtext" ///这是mvc路由 {controller}/{action}
data:{'name':'这是测试'}
success:function(data){
//回传的数据
}
})
//对应方法获取参数
【httppost】
public string funtext(string name)
{
//name就是 “这是测试”
}
//或者
【httppost】
public string funtext()
{
//Request.From可以获取页面传递的所有参数
//Request["name"].ToString();
}
//当然还有其他方法 就不一一说