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 5838609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:29:10+00:00 2026-05-22T11:29:10+00:00

I am trying to create a website that can let user to search images.

  • 0

I am trying to create a website that can let user to search images.
I created a local database ( a folder with a few images) for image, and there are 3 columns for data: title, picURL and keyword.

At my default page, I set up a textbox and Search button. What I did is:

string query = "SELECT picURL FROM imagedatabase WHERE [keyword] = '" + keyword + "'";

[keyword] is one of the name of the column and the keyword is the one user types in the textbox.

So now if I find an image in the database, then I got its URL. But how can I display the image in .aspx? like are they any specific command or something I can do to display the image?

thanks


EDIT:

So I changed the code like this:

In my homepage.aspx, I added in this:

<asp:Image ID="Image1" runat="server" ImageUrl="Image1.ImageUrl" />

and in my homepage.aspx.cs, I wrote this:

  protected void btnImageSearch_Click(object sender, EventArgs e)
{
    ImageSearch();
}
private void ImageSearch()
{
    string ImageURL;
   ImageURL= Process.KeywordSearch(txtSearch.Text);
   Image1.ImageUrl = ImageURL;

}

and in my Process.cs, I wrote this:

public static string KeywordSearch(string keyword)
{
    string query = "SELECT imagepath FROM tbimage WHERE [title] = '" + keyword + "'";       

    return query;

}

After I wrote all these, I tried to debug. I typed in the keyword, but no image showed up.
I know in Process.cs, query will get the URL in database (the URL is like C:\ ….)
So Image1.ImageUrl should equal to that URL. but then I am wondering if

can this really get the Image1.ImageUrl? because no image showed up.

Hope somebody can help and thanks

  • 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-22T11:29:11+00:00Added an answer on May 22, 2026 at 11:29 am

    for this you can use Image control of asp.net and set its ImageUrl property to your image url. Like this

    <asp:Image ID="Image1" runat="server" />
    

    and in CodeBehind

    Image1.ImageUrl = query;
    

    Do as follow

    1 Save or move your images into a
    folder.
    2 Add this folder into
    your solution or project.
    3 Take
    image name only (not physical path)
    from your database.
    4 Set
    ImageUrl property to virtual path.

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

Sidebar

Related Questions

I am trying to create a video that can be streamed on a website.
I am trying to create a database that can be used to store lots
I'm trying to create a PHP form on a website that collects users' name,
I'm a total noob trying to create a website with PHP. I created a
I am trying to create my own lightbox for images on my website. Yes,
I am trying to create a PHP file to upload images to my website.
I am trying to create a website that will have the following Web Access
I am trying to create a table for a website that is a fixed
I am trying to create a feature on my website where users can upload
I'm trying to create a script that will upload a file to a website.

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.