Click here to Skip to main content
16,019,529 members

Comments by TrishaC (Top 5 by date)

TrishaC 4-Sep-15 8:41am View    
I have used @Html.RadioButtonFor but i am still unable to fetch the value of Answer in my controller.
<label>@Html.RadioButtonFor(answer => model.Answer, "5", new { id = "Question" + model.QuestionSeq })Very Satisfied</label>
<label>@Html.RadioButtonFor(answer => model.Answer, "4", new { id = "Question" + model.QuestionSeq })Satisfied</label>
<label>@Html.RadioButtonFor(answer => model.Answer, "3", new { id = "Question" + model.QuestionSeq })Neither Satisfied nor Dissatisfied</label>
<label>@Html.RadioButtonFor(answer => model.Answer, "2", new { id = "Question" + model.QuestionSeq })Dissatisfied</label>
<label>@Html.RadioButtonFor(answer => model.Answer, "1", new { id = "Question" + model.QuestionSeq })Very Dissatisfied</label>

Is there something i am missing?
TrishaC 4-Sep-15 5:38am View    
if (model.AnsType.Equals("Scale2"))
{
<label>@Html.RadioButtonFor( model => model.QuestionSeq, false, new { id = "TermsAndConditions_false" } )Much Better</label>
}
the above block for me is a loop and the requirement is such that this block gets executed several times. As a result i have the same radiobutton name for all the radio buttons in the page (whichever uses the above five options).
TrishaC 3-Sep-15 11:00am View    
@Html.EditorFor(modelItem => item.Answer) retains the value that i enter but the following values are coming as null:

@Html.DisplayFor(modelItem => item.ProjectID)
@Html.DisplayFor(modelItem => item.FeedbackNo)

I need these values in my controller as i display them on the view.
TrishaC 25-Aug-15 12:25pm View    
I found my mistake. I was defining just 1 key in the class whereas the DB table had a composite key.

[Key]
[Column(Order = 0)]
public int ProjectID { get; set; }
[Key]
[Column(Order = 1)]
public int FeedbackNo { get; set; }
[Key]
[Column(Order = 2)]
public int CustomerPersonNo { get; set; }
[Key]
[Column(Order = 3)]
public int QuestionSeq { get; set; }
public int QuestionID { get; set; }
public int Applicable { get; set; }
TrishaC 25-Aug-15 6:39am View    
Yes, i did debug it. 'allFeedbcks' returns 10 rows of repeated data. My table has 10 rows of unique data. I am facing this problem with just this table. The same logic works fine for another table that i am trying to fetch.