asp.net mvc 3 - passing data between page to controller -
i have poll in web site , each poll have dynamic answer answer save database want edit answer
answer = new answer(); var ans = an.readbybyqid(int64.parse(viewdata["id"].tostring())); <div class="editor-label"> answer </div> <div class="editor-field"> @foreach (var item in ans) { <input type="text" name="answer" value="@item.answere" /> } </div>
i want id of answer in controller edit answer in database
save id in hidden input , form post data have answerid
, can access in action same way access answer.
answer = new answer(); var ans = an.readbybyqid(int64.parse(viewdata["id"].tostring())); <div class="editor-label"> answer </div> <div class="editor-field"> @foreach (var item in ans) { <input type="text" name="answer" value="@item.answere" /> <input type="hidden" id="answerid" value="@ans" /> } </div>
Comments
Post a Comment