我无法隐藏Url参数,

时间:2013-03-14 04:56:13

标签: asp.net-mvc-4

@Html.ActionLink("LotNumberDetails", "Index", "LotNumber", new { id = item.lotNUmber }, null)

这是我在表格中的操作链接,当我点击LotNumber ActionLink时,它会生成以下网址:

http://servername.com/LotNumber/Index/1111_100868781211

控制器中的方法如下:

[HttpGet]
    public ActionResult Index(string id)
    {
        var TupleResult = objLotNumberModel.GetLotNumberValuesEnumerable(id);
        return View("Index", TupleResult);
    }

一切正常,但是当我将ActionLink更改为Ajax.ActionLink ...

@Ajax.ActionLink("LotNumber", "Index", "LotNumber", new { id = item.lotNUmber }, new AjaxOptions { HttpMethod = "POST"})

和控制器方法......

[HttpPost]
    public ActionResult Index(string id)
    {
        var TupleResult = objLotNumberModel.GetLotNumberValuesEnumerable(id);
        return View("Index", TupleResult);
    }

该方法正在解雇,但我无法移动到相应的页面。

我的想法是隐藏LotNumber的ID,即点击ActionLink时我只想获取“http://servername.com/LotNumber/Index”这样的网址。

0 个答案:

没有答案