Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Post
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
2
Reply
cannot rename Model in dropdownlistfor
Asp.Net Hein
8 years ago
349
Reply
I want to add Dropdownlist in my MVC application but I have an error.
CS0135: 'Model' conflicts with the declaration 'System.Web.Mvc.WebViewPage<TModel>.Model'
This is my razor code for dropdownlist
@Html.DropDownListFor(a => a.UserId, new SelectList(
Model
.UserItems, "Id", "UserName"));
*Most of the reference said I cannot use Model in select list. But I cannot rename to others. Kindly support if you have any ways.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
How to implement CRUD for the table with foreign key
How to get the dropdownlist value?