Basically what I am trying is to create a feedback form with a question which has four answers (Radio Button) using MVC.
In View: I am
To, start with include a breakpoint in your view and check if the values are being passed or not.
Next, change your method signature from
public void Question(string Email,QuestionClass.Tabelfields tf)
to
public void Question(string email, QuestionClass.Tabelfields tf)
Also, I see you have used some strange syntax ( considering m also new to MVC ) where you could have simply used this
@Html.DisplayFor(modelItem => item.QuestionName)
instead of this
@Html.DisplayFor(modelItem => item.QuestionName,item)
and also, I have seen you profile, I know you are new to StackOverflow, so Welcome to StackOverflow ! you might want to read this & this as well. Cheers !
Update :
You are using this for displaying a radio button...
@Html.RadioButtonFor(modelItem =>item.SelectedOption, item.Option1, item)
what is item.Option1, I can see you have commented out Opion1,2,3,4. Or are you still using them ?
A very simple way of implementing this would be something like this
@Html.RadioButtonFor(modelItem =>item.SelectedOption, "Option1")
@Html.RadioButtonFor(modelItem =>item.SelectedOption, "Option2")
@Html.RadioButtonFor(modelItem =>item.SelectedOption, "Option3")
or you can also use,
@Html.RadioButtonFor(modelItem =>item.SelectedOption, item.Option1)
@Html.RadioButtonFor(modelItem =>item.SelectedOption, item.Option2)
@Html.RadioButtonFor(modelItem =>item.SelectedOption, item.Option3)
provided values exist in item.Option1/2/3/4 and are all of them are different.