What are different authentication types. How do you
retrieve user id in case of windows authentication?

Answer Posted / shilpa

to retrieve user id in case of windows authentication

if from a ASP.Net page following code

Dim username As String
username = User.Identity.Name

if it is from a class or business object following code

Dim User As System.Security.Principal.IPrincipal
User = System.Web.HttpContext.Current.User

Is This Answer Correct ?    12 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how to get records from a database?

856


Which window allows viewing the resources of the servers, such as services, processes and the event log?

773


Which event occurs when a user drags an item in a treeview or listview control?

728


Which template creates a .net compact framework 2.0 forms application for pocket pc 2003 and later?

724


Explain the difference between listbox and combo box?

691


Where to use new keyword other than create instance?

866


how print barcode

2281


Which property of the errorprovider control automatically sets to the form to which?

711


Name the property which is used to lock a textbox to enter data?

722


Explain how to split a column header in gridview using c#.net?

751


Explain how to net forms the windows?

738


Name the method that has to be overridden to change the appearance of the control that is inherited from an existing control.

745


What is form record?

705


Name the class to be inherited for creating a custom control.

743


What is the extension of a compiled help project file?

779