This article is about to explain how to create functionality to zoom an image in ASP.Net using Jquery and Elevate plug-in.
Requirement
Code
Write the below code in to your page. This is a Web application developed using VB.NET. Same code can be applied to a C# application as well.
- <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
- <!DOCTYPE html>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Image zoom</title>
- <script src='http://code.jquery.com/jquery-1.9.1.min.js'></script>
- <script src='jquery.elevateZoom-2.5.3.min.js'></script></head>
- <%--<script src='jquery.fancybox.js'></script>--%>
- <body>
- <div>
- <asp:Image ID="Image1" runat="server" ImageUrl="small/image_1.jpg" data-zoom-image="large/image_1.jpg"/>
- </div>
- <script>
- $("# Image1").elevateZoom({ gallery: 'gallery_01', cursor: 'pointer', galleryActiveClass: 'active' });
- //pass the images to Fancybox
- $("# Image1").bind("click", function (e) {
- var ez = $('# Image1).data('elevateZoom');
- return false;
- });
- </script>
- </body>
- </html>
Save all and run, view the page in a browser.

James CaravanPosted Sep 21, 2018, 1:18 PM
I like your example, but how is it set up when you have a variable set of images for the ImageUrl and data-zoom-image, rather than a constant literal for each?
Kruthi HegdePosted Jun 3, 2016, 1:17 AM
I need to zoom a text box which is present in a ASP grid...i could do it for the text box which is not within the grid...but since the textbox is within grid, its causing some problem...i am quite new to this...Any help on this is appreciated...Thanks