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
When generating the action link on the server you could put some special placeholder for the UserID route value:
@Ajax.ActionLink(
"Edit",
"EditUser",
"User",
new {
UserID = "__userid__"
},
new AjaxOptions {
OnSuccess = "ShowEditUserForm",
UpdateTargetId = "EditUserDetails",
InsertionMode = InsertionMode.Replace,
HttpMethod = "Get"
},
new {
@class = "button",
id = "EditUserButton"
}
)
and then when you assign a value to the hidden field in javascript you could update the action link href as well:
$('#EditUserButton').attr('href', function() {
return this.href.replace('__userid__', $('#NewUserID').val());
});