MVC Pass textbox to controller if not in a form tag

Posted by user1679820 on Stack Overflow See other posts from Stack Overflow or by user1679820
Published on 2012-09-18T09:36:40Z Indexed on 2012/09/18 9:37 UTC
Read the original article Hit count: 191

Filed under:
|
|

I am working on and Microsoft MVC3 project and cannot pass a parameter which has been edited to the controller. It will only pass back the original set parameter For example:

@Ajax.ActionLink("share file", InviteController.Actions.Result, InviteController.Name, new { message = Model.Message }, new AjaxOptions
            {
                HttpMethod = "GET",
                UpdateTargetId = "popup",
                OnSuccess = "$('#popup').dialog('open')"
            }, new { id = "popup-button" })

<label>Personal Message <span class="optional-message">(optional)</span></label>
@Html.TextAreaFor(x => x.Message)
</div>

This will pass the to the following controller but the 'message' parameter has the original message and not the updated message:

 public ActionResult Result(FormCollection coll, string message)
    {

I'd love if someone could give me some advice. Many Thanks

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about asp.net-mvc-3