Click here to Skip to main content
16,021,621 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am having a problem to make Notes reminder, unable to play audio on time and time is save on my table structure like this…


SQL
CREATE TABLE [dbo].[Notes](
    [SN] [int] IDENTITY(1,1) NOT NULL,
    [Title] [nvarchar](max) NULL,
    [Date] [date] NULL,
    [NoteTime] [nvarchar](20) NULL,
    [Status] [nvarchar](20) NULL,
 CONSTRAINT [PK_Table_1] PRIMARY KEY CLUSTERED
(
    [SN] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]


I have to play a sound on on date and NoteTime which is stored in my database..




XML
Index (View Page):-

 <p><source src="@Url.Action("myaudio")" type="audio/mp3" /></p>

Controller:-
<pre lang="c#">public ActionResult Index()
{
   var file = Server.MapPath("~/app_data/ipl.mp3");
   return File(file, "audio/mp3"); // I am unable to call two return in one view.
   return View(db.Notes.ToList()); // list of record from my database..

 }


• Individually works both but audio is not playing on date and time accroding to database because I don’t know how to do. it play on page load when we not return
return View(db.Notes.ToList());
• I want to show Title from my database on date and time with audio.
Posted
Updated 1-Jun-14 23:58pm
v7

1 solution

Create a class as a model in order to send back to view from your action for db.Notes and audio file.
After you can access objects as properties and you can use them in your view.
 
Share this answer
 
v2

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