How Can crate A Slide Show in asp.net page using java script and image is inside the sql database

Dani AI

Generated

For : two practical ways to build this are (A) store image files on disk and save paths in SQL, or (B) store image bytes (varbinary) in SQL and expose them through a server endpoint. Both work; option A is simpler and faster at scale. is right that the AJAX Control Toolkit gives a quick WebForms SlideShow control, and is right to point at jQuery sliders for more control and modern browsers.

A minimal workflow to follow:

  • Decide storage: prefer file paths for large galleries; use varbinary only if you must keep everything in the DB.
  • Create a server endpoint that returns image URLs (or serves raw bytes). If using DB blobs, make an ImageHandler (example URL: ImageHandler.ashx?id=123) that sets the correct Content-Type and cache headers.
  • On the page produce a JSON or HTML list of image URLs and captions from SQL (parameterized queries only).
  • Pick a client slider (AJAX Toolkit for quick WebForms integration; a jQuery plugin like Slick/Swiper for more options) and feed it the URL list.

Important tips and cautions: always use parameterized queries and using/Dispose for connections. Generate and serve thumbnails instead of full-size images to reduce bandwidth. Add Cache-Control/ETag headers on the handler and guard against large uploads. If images flicker or fail, check Content-Type, response length, and that the handler returns 2xx for valid IDs.

Recommended Answers

All 2 Replies

You can use 'AJAX Control Toolkit'. There is a SlideShow control. But if you want to use Javascript(which is the harder way) you could search Google. I suggest you to use AJAX Toolkit.

Take a look at jQuery demo about slide-show.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.