Buy Questpond's video subscriptions on
huge discount
.
Online: 1852
Home
Articles
Interviews
Forums
For Beginners
Popular Questions
ITIL Career Advice
PMP Career Advice
Career Advices
Codes
Videos
ASP.NET
ASP.NET MVC
Android Intel XDK
Sql Server
AngularJS
Bootstrap
Backbone.JS
MongoDB
LESS (CSS)
jQuery
WPF
WWF
SSIS
LightSwitch
Tutorials
News
ASP.NET MVC
|
Be Interview Ready
|
Top Performers
|
DNF MVP
|
Top Posts
|
Winners
|
Subscribe
|
Catalogs
Welcome Guest !
Register
Login
Home
>
Forums
>
C#
>
Loading ...
How to added in this items
Posted by
Jayakumars
under
C#
on 6/13/2017 |
Points: 10
| Views : 2210 | Status :
[Member]
[MVP]
| Replies : 1
Write New Post
|
Search Forums
|
Resolved Posts
|
Un Answered Posts
|
Forums Home
Hi
How to add Hrs,sec,am and pm in Dropdownlist in MVC5
I need like this Dropdownlist 5 min intervals
09:00 AM
09:05 AM
etc
09:00 PM
how to create this list and assign Dropdownlist mvc5
Mark as Answer if its helpful to you
Kumaraspcode2009@gmail.com
Reply
|
Reply with Attachment
Alert Moderator
Responses
Posted by:
Qyam
on: 6/14/2017
[Member]
Starter
|
Points: 25
0
Follow the below steps.
1. Create a table as below and insert above time interval values into it.
create table IntervalDetails
int id identity(1,1),
interval varchar(10)
2. create a model for the newly created table.
Public class ABC
{
public int id {get;set;},
publice string interval {get;set;}
}
3. Create a controller method to get intervals details from db and store into list.
public void LoadInterval()
{
List<ABC> li = new List<ABC>();
--fetch record from db and loop through all items and store into the list. Now pass list to view using viewdata.
ViewData["xyz"] = li;
}
4. Bind drop down
@Html.DropDownList("timeintervals", ViewData["xyz"] as List<ABC>)
hope it helps.
Jayakumars
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Login to post response
Latest Posts
Istikhara ka Tarika Dawateislami
(0)
How to get the exact property name while getting error
(0)
PDB file is not showing Line Number in dot net application hosted on server
(0)
Both Strings morethan 5 letters in length end of the words one vowel and one consonent is different
(0)
how to check Any adjacent letters transposed between two strings(ex: JOHN, JHON)
(1)
can't receive data after success login ?
(1)
Implement Multi-Tenant in Azure Logic Apps
(0)
Why ASP.Net Core 7.0 Web API showing as Connection refused?
(0)
More ...