Hi,

I am using active direcory based windows authentication in my intranet application as explained in the article http://weblogs.asp.net/scottgu/archive/2006/07/12/Recipe_3A00_-Enabling-Windows-Authentication-within-an-Intranet-ASP.NET-Web-application.aspx#457094.

Everything works fine. But I need a mechanism "Log in as another user" like in sharepoint portals. When user clicks on "Log in as another user" button, the borwser must prompt with the network authentication dialogue box where user must enter his Active directory user name and password. So my question is, how can i invoke browser's network authentication dialogue box from c# code? Is there any other way to implement this "Log in as another user" functionality?

Have you tried sending an HTTP 401 to prompt for credentials? That should invoke the dialog client side.

Hi,

How can i send http 401 from javascript? Can u give me sample code?
Also, i would like to do this from c#(for example, in a server side button's click)