Image server control - where am I going wrong?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John Austin

    Image server control - where am I going wrong?

    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
  • Bob Barrows [MVP]

    #2
    Re: Image server control - where am I going wrong?

    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.publi c.dotnet.framew ork.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"


    Comment

    • Walter Wang [MSFT]

      #3
      Re: Image server control - where am I going wrong?

      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 (wawang@online. microsoft.com, 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.

      Comment

      Working...