Image server control - where am I going wrong?

Discussion in 'ASP General' started by John Austin, Jul 26, 2006.

  1. John Austin

    John Austin Guest

    I thought I would experiment for the first time with an Image standard
    control in VS 2005. I pressed create web site, I copied a jpg into the
    App_Data folder, added an image control to Default.aspx and set the ImageUrl
    to the jpg ( ~/App_Data/Picture.jpg ). The picture appears in the designer,
    but when I run the page there is no picture.

    What am I doing wrong - I have no idea!
    --
    John Austin
     
    John Austin, Jul 26, 2006
    #1
    1. Advertising

  2. John Austin wrote:
    > I thought I would experiment for the first time with an Image standard
    > control in VS 2005. I pressed create web site, I copied a jpg into the
    > App_Data folder, added an image control to Default.aspx and set the
    > ImageUrl to the jpg ( ~/App_Data/Picture.jpg ). The picture appears
    > in the designer, but when I run the page there is no picture.
    >

    There was no way for you to know it (except maybe by browsing through some
    of the previous questions before posting yours - always a recommended
    practice) , but this is a classic asp newsgroup. ASP.Net bears very little
    resemblance to classic ASP so,
    while you may be lucky enough to find a dotnet-knowledgeable person here who
    can answer your question, you can eliminate the luck factor by posting your
    question to a group where those dotnet-knowledgeable people hang out. I
    suggest microsoft.public.dotnet.framework.aspnet.


    Don't use the App_Data folder. Create a folder called images and put the
    image file in that folder.
    From http://msdn2.microsoft.com/en-us/library/445z2s49.aspx:
    When you create a Web site in Visual Web Developer, Visual Web Developer
    creates a folder named App_Data below the current root folder. The folder is
    designed to be a store for application data, including Access databases. The
    App_Data folder is also used by ASP.NET to store databases that the system
    maintains, such as the database for membership and roles. When Visual Web
    Developer creates the App_Data folder, it grants Read and Write permissions
    for the folder to the ASPNET or NETWORK SERVICE user account.

    Note
    As a security measure, files in the App_data folder are not served by
    the Web server. Do not store any Web pages in the App_Data folder, because
    users will see an error if they request a page from that folder.



    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows [MVP], Jul 26, 2006
    #2
    1. Advertising

  3. Thanks Bob for your excellent and professional answer.

    Hi John,

    Thank you for using MSDN Managed Newsgroup Service!

    The reason why we recommend posting appropriately is you will get the most
    qualified pool of respondents, and other partners who the newsgroups
    regularly can either share their knowledge or learn from your interaction
    with us. Thank you for your understanding.

    Regards,
    Walter Wang (, remove 'online.')
    Microsoft Online Community Support

    ==================================================
    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Walter Wang [MSFT], Jul 27, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Miguel Dias Moura
    Replies:
    7
    Views:
    489
    Miguel Dias Moura
    Sep 28, 2004
  2. Stubbly Wubbly

    How do I find out what's going wrong?

    Stubbly Wubbly, Jun 29, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    508
    Stubbly Wubbly
    Jun 29, 2005
  3. les ander
    Replies:
    17
    Views:
    657
    Dale King
    Feb 29, 2004
  4. Fabian
    Replies:
    10
    Views:
    611
    Fabian
    Nov 4, 2003
  5. shapper
    Replies:
    1
    Views:
    318
    bruce barker \(sqlwork.com\)
    Nov 7, 2006
Loading...

Share This Page