Results 1 to 10 of 10

Thread: [RESOLVED] Image Control in ASP.net

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2010
    Posts
    66

    Resolved [RESOLVED] Image Control in ASP.net

    Hi all,

    I want to know, how insert image in image congrol. In image URL,

    i cant place pathname of local drive, where my image is located. How to pick

    from image?

  2. #2
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Image Control in ASP.net

    Hey,

    Are you talking about an image that you want the user to upload from their machine onto the server, or are you talking about an image on the hard drive of the web server.

    You will have to move the image into a folder under the main root of your web site, that way you can provide a navigatable url to the image, which you can reference from the client.

    Gary

  3. #3
    Frenzied Member avrail's Avatar
    Join Date
    Mar 2006
    Location
    Egypt, Cairo
    Posts
    1,221

    Re: Image Control in ASP.net

    hay,
    i think you should provide more information
    You Don't Have to Rate Me.
    I'm Not a Civilized Man I'm the Civilization it self
    White or Black, Living or Dieing and 0 or 1 that's MY life
    iam an Object in Object Oriented Life
    my blog : http://refateid.blogspot.com/
    twitter :@avrail
    010011000111010101110110001000000100110101111001001000000101000001100011

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jul 2010
    Posts
    66

    Re: Image Control in ASP.net

    Hey gep!!

    you are correct but i should know, how to find the main root folder and place my image. I had tried that, but i cant pick that image from root folder in imageurl.

  5. #5
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Image Control in ASP.net

    Hello rnjnagu,

    Are you hosting the site under IIS, or are you debugging it straight out of Visual Studio?

    The term root folder, normally refers to where the virtual directory in IIS points to. For ASP.Net Applications, this is typically the folder that contains the site's web.config file.

    Are you trying to provide a mechanism for users to upload images onto your site, or are you just trying to add images to your site through Visual Studio?

    Can you also elaborate on what you mean by:

    I had tried that, but i cant pick that image from root folder in imageurl.
    Because I am not sure that I follow.

    Gary

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Jul 2010
    Posts
    66

    Re: Image Control in ASP.net

    Hi gary,

    I am just trying to place image in visual studio. I am new to ASP.net. I am beginner

    For ex,

    I want to place my logo in webpage, how i should do that.

  7. #7
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Image Control in ASP.net

    Use the following steps:

    1) Open Solution Explorer
    2) Right click on your project and select Add | New Folder
    3) Give it a name (typically something like img, or images
    4) Right click on your new folder, and select Add | Existing Item...
    5) Browse to the file that you want to add, and click Add
    6) Select that image in solution explorer, open the Properties window for it, and make sure you set the "Copy to Output Directory" property to "Copy Always"

    From there, you should be able to navigate to the image when you set the ImageUrl property of you image control.

    Hope that helps!

    Gary

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Jul 2010
    Posts
    66

    Re: Image Control in ASP.net

    Hi Gary!!!

    Great!!! your instant helped works well to me...

    If any doubt i post my queries in this same forum..

    if you can, mention me asp.net beginners website.

  9. #9
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Image Control in ASP.net

    Hey,

    Glad to hear you got it working!!

    Can you remember to mark your thread as resolved?

    Personally, I learn a lot by watching videos, this is a great resource:

    http://www.asp.net/get-started

    You might also want to take a look at this post:

    http://www.vbforums.com/showthread.php?t=521851

    Gary

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Jul 2010
    Posts
    66

    Re: Image Control in ASP.net

    Ya.. i know how to change as resolved.. thanks.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width