Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8878343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:41:23+00:00 2026-06-14T19:41:23+00:00

My home page is displaying images slideshow using jquery,all these images are retrieving from

  • 0

My home page is displaying images slideshow using jquery,all these images are retrieving from mysql during the run time.I have created 9 images inside the division which are moving by jquery and i am giving the value of image url from codebehind.please see my code below,if database contains lesser than 9 images,null image should be hidden.how can i do it?

 <a href="#">

  DataTable dt = Db.ids("home_table");
Image1.ImageUrl = "~/Handler1.ashx?id=" + Convert.ToInt16(dt.Rows[0]["id"].ToString());


Image2.ImageUrl = "~/Handler1.ashx?id=" + Convert.ToInt16(dt.Rows[1]["id"].ToString());

This method is followed for all 9 images…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T19:41:24+00:00Added an answer on June 14, 2026 at 7:41 pm

    You get an error because you directly access rows that do not exist. You need to count the numbers of rows in your DT.

    numberOfRows = dt.Rows.Count 
    

    And after that

    if ( numberOfRows >= 2 )
    {
       Image2.ImageUrl = "~/Handler1.ashx?id=" + ...    }
    
    if ( numberOfRows >= 3 )
    {
       Image3.ImageUrl = "~/Handler1.ashx?id=" + ....    }
    

    etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my wordpress home page, i am displaying the archives using the function wp_get_archives('type=weekly&format=html')
When I run project in IIS, after displaying home page it will not allow
I am displaying recent comments on the home page of a blog application I
I want to hide primary menus in home page, Now my site displaying the
The home page of my wordpress website seems to be displaying correctly but if
I used image rotator for displaying a few images on the homepage. All image
Im using Magento CE 1.6.2.. I am displaying products from THREE different categories on
I have an Django app that displays user uploaded images on the home page.
so google ads are not displaying on the home page of my wordpress website,
I am using a image gallery in WordPress, images are fetching from database and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.