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, 2:20 PM
Tremendo aporte, Thank you so much :)
Ravi KushwahPosted Oct 23, 2018, 6:55 AM
Thanks alot man
Avinash ChormalePosted Jan 2, 2018, 4:57 AM
Thank you sir. This post help me in my project. Thanks a lot.
kalai romiPosted Oct 14, 2017, 7:20 AM
Thanks works fine...
Ralph MovPosted Jun 27, 2017, 11:03 AM
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, 5:02 PM
Where can i find the Zip file please?
kalu singh raoPosted Jul 8, 2016, 1:26 AM
Nice...
nora naderPosted Jun 5, 2016, 3:46 PM
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, 6:19 AM
It just work fine in pages that not using master page!!
ibrahimPosted Nov 12, 2015, 11:11 AM
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, 10:35 AM
Thanks works great! :D
Meenakshi SharmaPosted Sep 28, 2015, 3:35 AM
Select Bullets are not visible
YUSUF MOHAMEDPosted Sep 3, 2015, 1:58 AM
http://www.c-sharpcorner.com/uploadfile/raj1979/jquery-content-slider/#ReadAndPostComment
ramdas mhakavePosted Aug 13, 2015, 5:07 AM
thank u
Abbi Alvon MacalinoPosted Mar 20, 2015, 10:28 AM
tnx
Binish ShajiPosted Feb 18, 2015, 4:50 AM
tnx
Sushant ShindePosted Jan 29, 2015, 9:24 AM
I copied as it is,everything is working fine but "to select manual" round button is not visible...
sanukaji shresthaPosted Nov 19, 2014, 9:24 PM
how to add left and right arrow in image like bullet in buttom of the image\
Mamunur RashidPosted Oct 22, 2014, 12:15 PM
awesome
amoo goodarzPosted Sep 23, 2014, 9:29 AM
i have use an data source in SQL Server for my images.how I can?pleas answer me...
amoo goodarzPosted Sep 23, 2014, 9:27 AM
hi.thanks.
Phan HảiPosted Aug 17, 2014, 12:14 AM
thank a lot
titoo3071 .Posted Aug 16, 2014, 4:16 AM
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 16, 2014, 3:52 AM
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, 7:03 AM
nice super....
AdhirPosted Jun 27, 2014, 1:43 AM
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, 12:40 PM
Tanx ... is Very HelpFull
Vikram NarkarPosted Jun 5, 2014, 5:16 PM
Good one!
kiran solkarPosted Apr 21, 2014, 10:15 AM
Thanks Very Nic1
Jennifer CrisPosted Apr 10, 2014, 4:05 AM
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, 4:05 AM
thankz it was very helpfull
eswar raoPosted Mar 31, 2014, 10:22 AM
hey thank you so much.......
ram zyPosted Mar 27, 2014, 9:24 AM
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, 3:44 PM
awsm work :)
bunnsPosted Mar 14, 2014, 3:15 AM
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, 8:08 AM
thanx bhava...:)
Jitendra MPosted Jan 31, 2014, 12:35 AM
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 3, 2013, 3:29 AM
Very nice articale
Prabhat kumarPosted Nov 16, 2013, 8:47 AM
very useful.....thanks.