Showing posts with label login. Show all posts
Showing posts with label login. Show all posts

Wednesday, March 28, 2012

Why the value always is false?

Following is my codes. No matter I login or not,the userLoggedIn always be false. Why?

<%@dotnet.itags.org. Page Language="C#" AutoEventWireup="true" Codebehind="WebFormTest.aspx.cs" Inherits="EdtungWeb.WebFormTest" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title
<script language="javascript" type="text/javascript">
// <!CDATA[ function Test() { debugger var userLoggedIn = Sys.Services.AuthenticationService.get_isLoggedIn(); } // ]]> </script
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
</div>
<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="Test()" />
<asp:Login ID="Login1" runat="server">
</asp:Login>
<asp:LoginStatus ID="LoginStatus1" runat="server" />
</form>
</body>
</html>

and the loginstatus is retrieving the right information?


Yes, it is, the loginstatus is retrieving the rightinformation.

Many thanks for your replying.

Unless you use the AuthenticationService to Login the user it will remain false. One hack might be to inject the following line in your pages from the server side when you are sure the user is logged in.
Sys.Services.AuthenticationService._authenticated = true;

I see.

Many thanks for your replying.


Would you mind marking that as answer.

Sorry for that.

Many thanks for your remind.

why using Application Services?

Hi!

Why using Application Services?, I want put my login control in updatePanel?

Which is better?

Saludos,

Both is correct, this is what they call Client Side Model vs Server Side Model :-)


Oh, only that, Thanks :).

Saludos,

Wednesday, March 21, 2012

Wrapping a Login control with an UpdatePanel

Hi All,

This is my first ATLAS experiment. I'm trying to warp a Login control with an UpdatePanel. It seems that putting the UpdatePanel inside a template is not possible, which leaves me with the option of putting the Login control inside the ContentTemplate of the UpdatePanel instead. However, this results in the TriggerControlEvent not being able to reference the login button (which has to reside within the Login control in order to work, no?)

Kind of a chicken an egg problem it seems. Anyone has an idea how to acheive this behaviour?

Thanks,

Yuval

Just found out that the ControlTriggerEvent is not required, so no problem there.


hello.

1. you don't need a trigger if the control that has an event you want to handle is inside an updatepanel. the panel will detect the postback and treat it accordingly.

2. there are known issues that won't let you put the login control inside an update panel (search the foruns for a complete description of the problem).