TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Balwant Singh
NA
373
33.4k
Select List Selected .NET Core
Jan 1 2020 10:48 PM
I have and String in ViewBag.SubjectName="Hindi"
How Get Selected Item Select in Select List Selected .NET Core
<div>Subject :@foreach (var t in ViewBag.SubjectName)
{@t} , Topic : @foreach (var t in ViewBag.TopicName)
{@t} </div>
<div class="col-md-4">
<form asp-action="EditSubTopic">
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<input type="hidden" asp-for="SubTopicID" />
<div class="form-group">
<label class="control-label"></label>
<select id="SubjectID" class="form-control" asp-items="@(new SelectList(@ViewBag.SubjectList,"SubjectID","SubjectName"))"></select>
</div>
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<div class="form-group">
<label asp-for="TopicID" class="control-label"></label>
<select asp-for="TopicID" class="form-control" asp-items="@(new SelectList(string.Empty,"TopicID","TopicDisplayName"))"></select>
</div>
Reply
Answers (
6
)
c# simple expression Definition application *help*
C# Data base with Access