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

  • SEARCH
  • Home
  • 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 7527793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:11:45+00:00 2026-05-30T04:11:45+00:00

In my application (asp.net) I have an image control which by default has an

  • 0

In my application (asp.net) I have an image control which by default has an empty source. When a user clicks on a thumbnail, the clicked image is opened in that image control. The thing is that the images that can be viewed is uploaded by the user, and by that reason I can’t set a default image (because it’s not for sure that an image exists when the page is loaded).

The problem is that because the image src is empty when loading the page, a broken image link is displayed. When a thumbnail is clicked everything works fine.

One solution of this that I came up with is using jQuery to check if the image has an empty src, and if so hide it.

Below is the code that i’ve written for that, but by some reason nothing happens. What can be wrong (the code is loaded when a GET is done by the page)?

if ($("#fullSizeImage").attr(src="") == true) {
    $("#fullSizeImage").hide();
}
else {
    $("#fullSizeImage").show();
}

HTML:

<div id="fullImageArea"> 
    <img id="fullSizeImage" src="" /> 
</div>
  • 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-05-30T04:11:46+00:00Added an answer on May 30, 2026 at 4:11 am

    your validation should be like:

    if ($("#fullSizeImage").attr('src') == "") {
    

    And that’s because your using .attr() the wrong way, according to jQuery’s documentation: you can use .attr() the following ways:

    .attr( attributeName ) 
    

    Description: Get the value of an attribute for the first element in the set of matched elements.

    Or

    .attr( attributeName, value ) 
    

    Description: Set one or more attributes for the set of matched elements.

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

Sidebar

Related Questions

In my ASP.Net application I have a requirement that when a user clicks on
I have a small C# ASP.NET web application which generates several PNG image files
I have a GridView control in an Asp.net application, that has a <asp:buttonField> of
We have a Web application (ASP.NET) which displays in some page links to miscellaneous
I have ASP.NET MVC application that has list with jQuery Selectable list. My problem
I have an ASP.NET web application which does the following: Reads an Excel file.
I have a web application which is written in ASP.NET 4. I'm using IIS7
im trying to create a database for a feedback application in ASP.net i have
I have a web application (asp.net) where work items are submitted and allocated to
I have an application (ASP.NET MVC) that uses a Next New method to get

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.