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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:28:06+00:00 2026-06-04T10:28:06+00:00

I am working with a Silverlight business application that is using Windows Authentication. When

  • 0

I am working with a Silverlight business application that is using Windows Authentication.

When a user is signed into the machine, and access the Silverlight URL, the data they are presented with is based on their Windows sign in details. The user name is retrieved from the login status on the page like so-

string fullUserName = WebContext.Current.User.DisplayName;
string userName = fullUserName.Substring(fullUserName.IndexOf('\\') + 1);

So for instance the fullUserName here would be ‘machineName\UserName’ and then the second line gets rid of ‘machineName\’ to just leave the user name.

One the user name has been extracted from the page, it is used in a webservice call to bring back data based on that user account-

void OnLoad(object sender, RoutedEventArgs e)
    {
        string fullUserName = WebContext.Current.User.DisplayName;
        string userName = fullUserName.Substring(fullUserName.IndexOf('\\') + 1);


        WebService.Service1SoapClient client = new WebService.Service1SoapClient();

        client.IDReturnCompleted += new EventHandler<IDReturnCompletedEventArgs>(client_IDReturnCompleted);
        client.IDReturnAsync(userName);
    }

This works fine on all pages of the Silverlight apart from the home page, which is the first page when loaded. I believe this is due to the fact that the callbacks are asynchronous and therefore the value user name has not been initialised yet. But by the time a user has clicked on a new link, the value has loaded.

Is it possible to get this value in the Home page? I have tried it in both the load event and InitializeComponent on the home page but the value is not back from the web service yet.

  • 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-04T10:28:08+00:00Added an answer on June 4, 2026 at 10:28 am

    I do not think it is possible to get the current domain user with pure silverlight. You may check this question why it is not directly possible;
    Get current Windows user name within Silverlight

    On the otherhand, you may use inject this value from the aspx file to silverlight, refer to this link.

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

Sidebar

Related Questions

I am currently working on a silverlight business application, so I have come across
I am working on a silverlight app that you need to enter information into
I'm working on a Silverlight app that would allow a user to upload a
I'm working on a silverlight application where I'm checking the url to see if
I'm working on re-writing a WinForms application into Silverlight. One use case in the
While working with SilverLight using Visual Studio 10, I found that in design mode
I am working on a Silverlight application that has a Form that is supposed
I am working on a Silverlight application that uses WCF. I need to have
I am working in a Silverlight 4 application. I have a datagrid that I
I'm working on a Silverlight business app at the moment, and am getting into

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.