ASP.Net MVC 3.0 Ajax.ActionLink dynamic object route values using javascript

后端 未结 3 1063
执笔经年
执笔经年 2021-02-14 08:11

0 Project

In my view I have a hidden filed which has a UserID. This user id is generated upon an action (so this will not be know prior)

Once this

3条回答
  •  萌比男神i
    2021-02-14 08:34

    Maybe something like this would work. Put you action link in a div and modify it with jquery on the client side.

    @Ajax.ActionLink("Edit", "EditUser", "User", new { UserID = "$('#GetNewPatientID').val()" }, new AjaxOptions { OnSuccess = "ShowEditUserForm", UpdateTargetId = "EditUserDetails", InsertionMode = InsertionMode.Replace, HttpMethod = "Get" }, new { @class = "button", id = "EditUserButton" })

提交回复
热议问题