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
Julio Pz
NA
23
1k
How to make a video slide and images with asp.net?
Sep 5 2016 3:35 PM
I need to make a slide video and images with asp.net,
SlideExtender
only works with pictures, the only option left is to make conditional
updatepanel
with a
timer
but I ran out of ideas, please some other ideas:
HTML Code:
<
asp:ScriptManager
ID
=
"ScriptManager1"
runat
=
"server"
>
</
asp:ScriptManager
>
<
div
>
<
asp:Timer
ID
=
"SlideShowTimer"
runat
=
"server"
Interval
=
"5000"
OnTick
=
"SlideShowTimer_Tick"
>
</
asp:Timer
>
<
asp:UpdatePanel
ID
=
"SlideShowUpdPnl"
runat
=
"server"
UpdateMode
=
"Always"
>
<
ContentTemplate
>
<
div
id
=
"DivSlide"
>
<
img
id
=
"SlideShowImage1"
src
=
"images/logo11.png"
runat
=
"server"
alt
=
"Sanmina-SCI"
visible
=
"true"
/>
<
video
runat
=
"server"
id
=
"SlideShoVideo"
src
=
"Uploads/Avideo1.mp4"
controls
=
"controls"
autoplay
=
"autoplay"
visible
=
"true"
/>
<
asp:Label
ID
=
"LblTitleSlideShow"
runat
=
"server"
Text
=
""
>
</
asp:Label
>
</
div
>
</
ContentTemplate
>
<
Triggers
>
<
asp:AsyncPostBackTrigger
ControlID
=
"SlideShowTimer"
EventName
=
"Tick"
/>
</
Triggers
>
</
asp:UpdatePanel
>
</
div
>
Code Behind:
protected
void
SlideShowTimer_Tick(
object
sender, EventArgs e)
{
DateTime later = DateTime.Now.AddSeconds(.5);
while
(DateTime.Now < later)
{
LblTitleSlideShow.Text =
"Time Later : "
+ later;
}
this
.SlideShowImage1.Src = RandomImageName();
this
.LblTitleSlideShow.Text +=
this
.SlideShowImage1.Src.ToString();
}
private
string
RandomImageName()
{
Random rand =
new
Random();
int
RandomInt = rand.Next(0, 5);
string
url =
null
;
switch
(RandomInt)
{
case
0:
url =
"../Uploads/Jellyfish.jpg"
;
break
;
case
1:
url =
"../Uploads/Lighthouse.jpg"
;
break
;
case
2:
url =
"../Uploads/sanmina-logo.png"
;
break
;
case
3:
url =
"../Uploads/Tulips.jpg"
;
break
;
case
4:
url =
"../Uploads/Koala.jpg"
;
break
;
case
5:
url =
"../Uploads/Penguins.jpg"
;
break
;
default
:
url =
"../Uploads/123.png"
;
break
;
}
return
url;
}
Reply
Answers (
1
)
get data from different table in web application
I am changing my style