Click here to Skip to main content
15,898,035 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
HTML
@model IEnumerable<CastroAnthony.Models.Evaluation_Questions>
<nav>
    <ul id="actionlink">
        @foreach (var Question in Model)
        {  
            <li>@Html.TextBoxFor(Question.QuestionDiscription)</li>            
        }
    </ul>
</nav>



this is my view
and i try to get this question discription from database.
but i am not be able to use @html.textboxfor() in my code
it give me this error
cannot be inferred from the usage. try specifying the type arguments explicitly
and red underline over this line

  • @Html.TextBoxFor(Question.QuestionDiscription)
Posted
Comments
Richard MacCutchan 27-Feb-13 5:16am    
You have declared Question as a var type. The sytem is just telling you that it cannot figure out what actual type it should be, so you need to make your declaration specific.
Sandeep Mewara 27-Feb-13 8:32am    
OP's comment:
Basically i want to get the question from database.so i i using @foreach(var Question in model) please guaid me how can i do that i am new on MVC and Razor
Richard MacCutchan 27-Feb-13 9:33am    
Thanks. We must get the word "Reply" translated into more languages (including English). ;)
Sandeep Mewara 27-Feb-13 9:59am    
Or may be a little darker 'Reply' even without mouse over on the comment. :)
prince_rumeel 27-Feb-13 5:19am    
Basically i want to get the question from database.so i i using @foreach(var Question in model)

please guaid me how can i do that
i am new on MVC and Razor

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900