Hi everybody,
My request out here is Urgent, though i have passed through what I could access in this forum and others also, but cannot finding a working solution.
I have designed an ASP.NET application, at our organizational intranet, I have used Windows Authentication and it worked very efficiently. My problem is, I want my application to ask for re-entering of employee's credential when he clicked on a log out control ( it could be anything - i didn't decided what will trigger log out yet ). I want it to be like Sharepoint page where you can log as another user in the same machine.
I m using following code but not working properly.
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
_User = User.Identity.Name.Replace("Domain\\", "");
Label1.Text = _User;
}
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
Response.StatusCode = 401;
Response.StatusDescription = "Unauthorized";
Response.End();
Response.Redirect("Default.aspx");
}
and my HTML or aspx CODE IS
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<p>Hello <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label></p>
<asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click">Sign in as Different user</asp:LinkButton>
</div>
</form>
</body>
</html>
I am waiting ...
Thanks.