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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:08:42+00:00 2026-05-26T02:08:42+00:00

I am developing a internal .Net application in VS2010 for deployment within my company’s

  • 0

I am developing a internal .Net application in VS2010 for deployment within my company’s intranet. The site uses Windows Authentication so that users do not have to log in when they are successfully authenticated to the domain. For one page, it is required that I get some information from the intranet including photos and other information. For the employee photo, I am using a control:

<asp:Image ID="imgPhoto" Style="display: inline-block" runat="server" CssClass="EmployeePhoto"
                alt="Photo not available" />

From the back end, this allows me to change which photo is displayed depending on user choices by changing the photo url as follows:

imgPhoto.ImageUrl = string.Format("http://{0}/{1}.jpg", MySitePath, employeePhotoPath);

The path is password protected however.Is there any way to explicitly provide the credentials used to access the asp:image so that I can pass in the credentials of the current authenticated user without the user being prompted to authenticate?

UPDATE

There used to be a way to specify the username + password into the img tag like:

<img src="http://username:password@server/photos/1.jpg"> 

or something similar. So that the credentials are available to access the directory? Is this possible in any way now?

  • 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-26T02:08:42+00:00Added an answer on May 26, 2026 at 2:08 am

    I ended up using the WebClient class to set the credentials to authenticate to the other server and then download the photo locally:

                    WebClient myWC = new WebClient();                    
                    myWC.Credentials = new System.Net.NetworkCredential(bioSearchUsername, bioSearchPassword);
                    string photoPath = Server.MapPath("~/images/Employees/" + employee + ".jpg");
                    myWC.DownloadFile(imageLocation, photoPath);
    

    After that, I referenced the local copy of the photo on the server:

    imgPhoto.ImageUrl = photoPath;
    

    This got around the authentication problems I was running into with the image.

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

Sidebar

Related Questions

I am developing an ASP.NET intranet application that needs to have an interactive map
I'm currently developing a internal application for a company that does patient transport between
I'm developing tools for a WPF clickonce XBAP application for internal deployment within a
Scenario I am developing an internal CakePHP company application that has a despatch screen,
I'm developing an application for an internal customer. One of the requirements is that
I'm developing an internal web application, that allows me to store remote control credentials
I'm currently developing a moderately large sized web app with ASP.NET 2.0 that uses
I am relatively new to C#/.Net. I'm developing a desktop application that requires multi
Currently I'm developing a Blackberry Application to access internal business contacts in our company.
Developing a .NET WinForms application: how can I check if the window is in

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.