Hello Everyone.
I am new to jQuery. I have a Html.TextArea called "CommentPost" displayed for each item in a foreach loop. I am trying to return the data typed into my text area as a parameter in my ActionLink call. The first parameter item.CommentId get populated correctly but the second one item.CommentPosting evaluates as null.
I thought that maybe a jQuery call - when the ActionLink gets selected - could sort this out for me. I have been trying to solve this for hours now but am not getting any closer. I know that $('#CommentPost').attr("value")
gives the correct text but how to put it all together is beyond me. Please help
<% foreach (var item in Model.Comments)
{ %>
<%= (item.UserName ) %>
<%= Html.TextArea("CommentPost", item.CommentPosting)%>
<%= Html.ActionLink("Save", "CommentPosting", new { commentId = item.CommentId , commentPost =item.CommentPosting})%>
<% }%>
The shell of my controller code looks as follows:
[AcceptVerbs(HttpVerbs.Get)]
public ActionResult CommentPosting(int commentId, string commentPos)
{
}