Skip to main content

Microsoft Silverlight

Answered Question Loggedin UsernameRSS Feed

(0)

tomchan
tomchan

Member

Member

1 points

5 Posts

Loggedin Username

How can I get the logged-in username in my Silverlight Application? I created a sample application & I want to see the username on top of the application. Please help me in this scenario.

microsoft_kc
microsof...

Contributor

Contributor

2890 points

564 Posts

Answered Question

Re: Loggedin Username

Use:   Xaml1.InitParameters = "username=" + this.Request.ServerVariables["LOGON_USER"];   and then catch it from the code behind to display it...

Remember: Please click on "Mark As Answer", if this answered your query partially or fully.


Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog

tomchan
tomchan

Member

Member

1 points

5 Posts

Re: Loggedin Username

What is this InitParameters? Actually, I am new to Silverlight. How can I catch it from the code behind?

microsoft_kc
microsof...

Contributor

Contributor

2890 points

564 Posts

Answered Question

Re: Loggedin Username

InitParameter uses dictionary key/value pair to pass values from parent asp.net page to the silvelright application. You can catch it from the App.xaml.cs inside the Application_Startup event.

Remember: Please click on "Mark As Answer", if this answered your query partially or fully.


Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog

Sergey.Barskiy
Sergey.B...

Member

Member

40 points

31 Posts

Answered Question

Re: Loggedin Username

I wrote a small blog post on this subject.  You can find more inforamtion and sample source code here: http://dotnetspeak.com/index.php/2009/10/dynamically-setting-initialization-parameters-in-silverlight-application/

 

Sergey Barskiy.

tomchan
tomchan

Member

Member

1 points

5 Posts

Re: Loggedin Username

Thank you guys.

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities