Hi,
I need your help with login implementation in my ASP.NET 2.0 demo
application.
I have custom login control on my default.aspx page:
....
<form id="LoginForm" runat="server"
method="post" action="Welcome.aspx" style="vertical-align:
middle;">
<asp:ImageButton ID="DotNETImage" runat="server"
ImageUrl="~/Images/DotNET_360x280.jpeg"
AlternateText="Microsoft .NET version 2.0"
Width="360" Height="280"
OnClick="OnClickImage" />
<asp:PlaceHolder ID="LoginPlaceHolder" runat="server" />
</form>
....
public partial class DefaultPage : System.Web.UI.Page
{
class DemoLogin : Login
{
public DemoLogin(string ID) : base()
{
this.ID = ID;
...
}
override protected void OnAuthenticate(AuthenticateEventArgs
e)
{
e.Authenticated = (UserName != "" && Password == "demo");
}
}
private DemoLogin login;
private void Page_Load(object sender, EventArgs e)
{
login = new DemoLogin("DemoLogin");
LoginPlaceHolder.Controls.Add(login);
}
// Image button clicked:
public void OnClickImage(object sender, EventArgs e)
{
// Here I would like to call authentication!
}
}
....
I would like to call authentication procedure when image button is
pressed - equivalence of Login button click; perhaps I should raise
login.Authenticate event but I don't know how. Could you help me
please?
Thank you for your answers!
/RAM/