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

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -