0

当我调用 javascript 并获取值并发布到某个 URL 时,我使用 Webgrid 上方的一个下拉框来动态更改每页的行数..但它不会发布到我的控制器 Actionresult 方法....所以请帮忙它;紧急..!我尝试了很多方法..但这一切都不适用于我的项目,请任何人对我的错误有想法......我的可用声明..

$.ajax(
{
    type: 'POST',
    url: '/Admin/UserActive/' + strvalue,
    data: strvalue,
    datatype: "String",
    success: function (result) 
    {
    }
});



$.post('@Url.Action("UserActive","Admin", new{})' + '?Id=' + strvalue);
$.post('@Url.Action("UserActive","Admin")', { Id: strvalue });


$.post('@Url.Action("/Admin/Pagesize")', { rowsPerPage: value });
$.post('/Admin/UserActive',
{
    id: strvalue.toString(),

});

所有语句都在我的 javascript 函数中用于将控件发布到我的 actionresult 方法以执行一些逻辑..但是当 post 语句不起作用或不正确时,请..给出提示..

当我在我的新项目中使用它时,所有这些语句都是有效的,它在我当前的应用程序中不起作用。

4

1 回答 1

0

在您的操作中添加一个与您的下拉列表同名的参数,然后发布或调用操作并根据下拉值中给出的页面大小返回结果。

例如。

public ActionResult UserAgent(string yourDropDownName)
{
}
于 2013-03-04T08:56:37.703 回答