Saturday, 17 August 2013

Passing value of an input control to controller

Passing value of an input control to controller

I have the following:
@Html.BeginForm("AddComment", "Shared", new { guid = Model.VideoGuid,
content="", userid = authenticatedUserId.ToString()}){
<div class="input-group">
<input name="txtCommentContent" type="text"
class="form-control"><span class="input-group-btn">
<button class="btn btn-default">
<img src="~/Content/images/Message-Add.png"
/></button>
</span>
</div>
}
I need to pass the text input inside the input control to the control as
part of the routeValues. The above content="" is going to do that.
How can this be done?

No comments:

Post a Comment