Introduction
Here you will see a jQuery image sliders control that is very useful for displaying images and photos and making the viewing of images more pleasant and intuitive on our website. In this article, we make an auto-playing image slider. Users can also manually select content to see or have them rotated automatically.
Use the following simple procedure to create a sample.
Step 1: Create a simple application in Visual Studio.
Step 2: Now add the references of CSS and js files in the head section.
- <head runat="server">
- <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
- <link href="Styles/nivo-slider.css" rel="stylesheet" type="text/css" />
- <link href="Styles/Default.css" rel="stylesheet" type="text/css" />
- <script src="Scripts/Demo.js" type="text/javascript"></script>
- <title></title>
- </head>
These files above are attached in the Zip file. You can download these files from the attached file.
Step 3: Now add the following code to the body section that contains four images on the page.
- <body>
- <form id="form1" runat="server">
- <div class="slider-wrapper theme-default">
- <div id="nivo-slider" class="nivoSlider" style="width: 960px">
- <img src="1.jpg" alt="" />
- <img src="2.jpg" alt="" />
- <img src="3.jpg" alt="" />
- <img src="4.jpg" alt="" />
- </div>
- </div>
- </form>
- </body>
Step 4: Now add the following .js code to the body section.
- <script type="text/javascript">
- $(window).load(function () {
- $('#nivo-slider').nivoSlider();
- });
- </script>
Step 5: Default.ASPX code
- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <title></title>
- <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
- <link href="Styles/nivo-slider.css" rel="stylesheet" type="text/css" />
- <link href="Styles/Default.css" rel="stylesheet" type="text/css" />
- <link href="Styles/nivo-slider.css" rel="stylesheet" type="text/css" />
- <script src="Scripts/Demo.js" type="text/javascript"></script>
- </head>
- <body>
- <form id="form1" runat="server">
- <div class="slider-wrapper theme-default">
- <div id="nivo-slider" class="nivoSlider">
- <img src="1.jpg" alt="" />
- <img src="2.jpg" alt="" />
- <img src="3.jpg" alt="" />
- <img src="4.jpg" alt="" />
- </div>
- </div>
- <script type="text/javascript">
- $(window).load(function () {
- $('#nivo-slider').nivoSlider();
- });
- </script>
- </form>
- </body>
- </html>
Step 6: Now run the application.
We can manually select an image from the Slider.


alex masterPosted Nov 11, 2020, 9:20 AM EST
Tremendo aporte, Thank you so much :)
Ravi KushwahPosted Oct 23, 2018, 2:55 AM EDT
Thanks alot man
Avinash ChormalePosted Jan 1, 2018, 11:57 PM EST
Thank you sir. This post help me in my project. Thanks a lot.
kalai romiPosted Oct 14, 2017, 3:20 AM EDT
Thanks works fine...
Ralph MovPosted Jun 27, 2017, 7:03 AM EDT
Thanks for the demo, I had to make some tweaks (CodeFile, Inherits, partial class name) but got it working. See here for explanation of plugin settings: http://www.jqueryscript.net/slider/nivo-slider.html
ibrahim yasPosted Oct 28, 2016, 1:02 PM EDT
Where can i find the Zip file please?
kalu singh raoPosted Jul 7, 2016, 9:26 PM EDT
Nice...
nora naderPosted Jun 5, 2016, 11:46 AM EDT
I want to make it in master page but it did not work .how adding image slider in content page in master page.
Mohamed ElshawafPosted Jan 14, 2016, 1:19 AM EST
It just work fine in pages that not using master page!!
ibrahimPosted Nov 12, 2015, 6:11 AM EST
I am trying to do this but it doesnt work. i gave a size for the pics but it is bigger than i gave the size. Can anyone help me for this problem to solve it ?
Bradley HansenPosted Oct 27, 2015, 6:35 AM EDT
Thanks works great! :D
Meenakshi SharmaPosted Sep 27, 2015, 11:35 PM EDT
Select Bullets are not visible
YUSUF MOHAMEDPosted Sep 2, 2015, 9:58 PM EDT
http://www.c-sharpcorner.com/uploadfile/raj1979/jquery-content-slider/#ReadAndPostComment
ramdas mhakavePosted Aug 13, 2015, 1:07 AM EDT
thank u
Abbi Alvon MacalinoPosted Mar 20, 2015, 6:28 AM EDT
tnx
Binish ShajiPosted Feb 17, 2015, 11:50 PM EST
tnx
Sushant ShindePosted Jan 29, 2015, 4:24 AM EST
I copied as it is,everything is working fine but "to select manual" round button is not visible...
sanukaji shresthaPosted Nov 19, 2014, 4:24 PM EST
how to add left and right arrow in image like bullet in buttom of the image\
Mamunur RashidPosted Oct 22, 2014, 8:15 AM EDT
awesome
amoo goodarzPosted Sep 23, 2014, 5:29 AM EDT
i have use an data source in SQL Server for my images.how I can?pleas answer me...
amoo goodarzPosted Sep 23, 2014, 5:27 AM EDT
hi.thanks.
Phan HảiPosted Aug 16, 2014, 8:14 PM EDT
thank a lot
titoo3071 .Posted Aug 16, 2014, 12:16 AM EDT
i copied and it worked with limitations in it . limitation was the "to select manual" thing was not visible after publishing to web server iis before that in visual studio it is visible. can u help in this regard.? it happens in Internet explorer
titoo3071 .Posted Aug 15, 2014, 11:52 PM EDT
i copied and it worked with limitations in it . limitation was the "to select manual" thing was not visible after publishing to web server iis before that in visual studio it is visible. can u help in this regard.?
dharma lingamPosted Aug 11, 2014, 3:03 AM EDT
nice super....
AdhirPosted Jun 26, 2014, 9:43 PM EDT
Nice article... But I need it with database. While searching I found this article about responsive and database driven image slider in asp .net: http://www.codingfusion.com/Post/Dynamic-Nivo-Responsive-Image-slider-with-database
Ali FarajniaPosted Jun 20, 2014, 8:40 AM EDT
Tanx ... is Very HelpFull
Vikram NarkarPosted Jun 5, 2014, 1:16 PM EDT
Good one!
kiran solkarPosted Apr 21, 2014, 6:15 AM EDT
Thanks Very Nic1
Jennifer CrisPosted Apr 10, 2014, 12:05 AM EDT
im using a site which is applicable even in mobiles so i need the size to be like height:83px, and width as 430px whr do i make the changes
Jennifer CrisPosted Apr 10, 2014, 12:05 AM EDT
thankz it was very helpfull
eswar raoPosted Mar 31, 2014, 6:22 AM EDT
hey thank you so much.......
ram zyPosted Mar 27, 2014, 5:24 AM EDT
I have applied the code given at this link but problem is that it showing full image as I set width = auto but when i give value to this width ... it min/max the width but doest not resizing the image :/
ram zyPosted Mar 26, 2014, 11:44 AM EDT
awsm work :)
bunnsPosted Mar 13, 2014, 11:15 PM EDT
Hi, can we add a transparent box with some message to the image (which should appear on each image a diff. msg. which says about the image) ? I have seen your CSS since i am new to CSS i am confused how to add a new element in there.
pranay patilPosted Mar 10, 2014, 4:08 AM EDT
thanx bhava...:)
Jitendra MPosted Jan 30, 2014, 7:35 PM EST
where can we change the next, prev images and where can we change the numbers "1 2 3 4" and put bullets images?
Former memberPosted Dec 2, 2013, 10:29 PM EST
Very nice articale
Prabhat kumarPosted Nov 16, 2013, 3:47 AM EST
very useful.....thanks.