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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:48:12+00:00 2026-06-18T15:48:12+00:00

hello again. We have a webform that employees use to make request for such

  • 0

hello again.

We have a webform that employees use to make request for such things as VPN access to the company resources from remote locations.

I am populating a dropdownlist box from Active Directory. This works fine.

Then I have a textbox that is also populated from Active Directory by simply assigning the value of the logged in user as shown:

textbox1.Text = User.Identity.Name

Based on the value of my name assigned to textbox1.Text

The rest of the texboxes are populated with my work information with the following code:

    textbox1.Text = User.Identity.Name
    textbox1.Text = StrConv(textbox1.Text, vbProperCase)

    txtdate.Text = DateTime.Now.ToString("MM/dd/yyyy")
    Try
        'Creates a Directory Entry Instance with the Username and Password provided
        Dim deSystem As New DirectoryEntry("LDAP://OU=Departments,DC=domaname, DC=com", "usrname", "password")

        'Authenticacion type Secure
        deSystem.AuthenticationType = AuthenticationTypes.Secure

        'Creates a Directory Searcher Instance
        Dim dsSystem As New DirectorySearcher(deSystem)

        'sAMAccountName is equal to our username passed in.            
        dsSystem.Filter = "sAMAccountName=" & textbox1.Text

        'Properties that the Procedures will load from Active Directory
        dsSystem.PropertiesToLoad.Add("mail") 'email address
        dsSystem.PropertiesToLoad.Add("department") 'dept
        dsSystem.PropertiesToLoad.Add("physicalDeliveryOfficeName") 'office
        dsSystem.PropertiesToLoad.Add("title") 'title, eg programmer1
        dsSystem.PropertiesToLoad.Add("telephoneNumber") 'phone
        dsSystem.PropertiesToLoad.Add("streetAddress") 'street address
        dsSystem.PropertiesToLoad.Add("l") 'city
        dsSystem.PropertiesToLoad.Add("st") 'state
        dsSystem.PropertiesToLoad.Add("postalCode") 'zip code
        dsSystem.PropertiesToLoad.Add("EmployeeId") 'empid 
        dsSystem.PropertiesToLoad.Add("givenName") '//first name from active directory
        dsSystem.PropertiesToLoad.Add("sn") '//lastname from active directory
        'Find the user data
        Dim srSystem As SearchResult = dsSystem.FindOne()

        'Obtains the properties recently loaded
        txtemail.Text = srSystem.Properties("mail").Item(0).ToString
        dept.Text = srSystem.Properties("department").Item(0).ToString
        office.Text = srSystem.Properties("physicalDeliveryOfficeName").Item(0).ToString
        txttitle.Text = srSystem.Properties("title").Item(0).ToString
        phone.Text = srSystem.Properties("telephoneNumber").Item(0).ToString
        workaddress.Text = srSystem.Properties("streetAddress").Item(0).ToString
        city.Text = srSystem.Properties("l").Item(0).ToString
        state.Text = srSystem.Properties("st").Item(0).ToString
        zipcode.Text = srSystem.Properties("postalCode").Item(0).ToString
        hiddenempId.Value = srSystem.Properties("EmployeeId").Item(0).ToString
        HiddenFName.Value = srSystem.Properties("givenName").Item(0).ToString
        HiddenLName.Value = srSystem.Properties("sn").Item(0).ToString

This works fine as well.

Here is where my problem lies.

Initially, when the user logs in, based on logged user name from Active Directory, the rest of the textboxes get populated with the user’s info.Sorry for repeating myself here.

However, sometimes, the user logged in is not necessarily the user needing reguest.

In other words, I can log in to fill a request for another employee.

In this case, I am required to select the name of the user I am completing the request for from the dropdownlist that is populated from Active Directory.

When I select this name from dropdownlist, it replaces my own name on textbox1.Text.

This works fine but the rest of the textboxes retain my own information.

What do I need to do to ensure that the name that replaces my original name on textbox1.Text also replaces the information on the rest of the textboxes?

I will post additional information as requested.

Many thanks in advance

  • 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-06-18T15:48:14+00:00Added an answer on June 18, 2026 at 3:48 pm

    Instead of loading all the text boxes when the form loads, load them from the TextChanged event of the user name text box. That way, any time the user name text box changes, all the other text boxes will automatically be re-loaded to reflect the change.

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

Sidebar

Related Questions

Hello again everyone, This time I have a problem with Intent & Extras. here's
Hello again Stackoverflow people! Assume I have these words: smartphones, smartphone I want to
Hello I've runned in to a problem again that I can't solve on my
On my C# asp.net webform I have a search page that has roughly 20
Hello again stackoverflow... Once again I have a troublesome problem. I have a page
Okay hello everyone! I have another problem again.. I'm getting an unhandled exception. I
Hello there once again... I came up with an strange idea but I have
Hello I have a table that has an id field and a parentid field.
For example: I have a txt file like : text(hello) text(world) text(once) text(again) Aim
Hello I have a ActionScript 3.0 project and I have a timer that is

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.