Re: 2 questions please



On Wed, 11 Jul 2007 08:30:35 -0000, Masudur <munnacs@xxxxxxxxx> wrote:

On Jul 11, 12:35 pm, cke...@xxxxxxxxxx wrote:
I have a page that has a LogInView. Inside of it is a LogIn control.
The login control is in the anonymous template and a staus view is in
the logged on template. (Names: LogInView1, Login1, & LogInStatus1.)

quest 1. How can I set focus to the UserName textbox of the LogIn
control (inside of LogInView)?

quest 2. I want to assign the UserName value to a session variable
when the LogIn btn is clicked, how can I do this?

tia

ck

Hi

User Javascript to set focus to the textbox..... of the login control

and in loggedin event of the logincontrol user the following code to
save the user name

Session["UserName"] = Page.User.Identity.Name;

by the way why you need to save the user name in session?

you always have "Page.User.Identity.Name" to get the current username

Thanks
Md. Masudur Rahman ( Munna )
kaz Software Ltd.
http://www.kaz.com.bd
http://munnacs.110mb.com

Should i put the javascript to set focus in the body tag? How should
it look since the control I'm going for is nested?

I have tried this:

Protected Sub Login1_LoggedIn(ByVal sender As Object, ByVal e As
System.EventArgs)
MsgBox(Me.LoginView1.Page.User.Identity.Name)
MsgBox(Page.User.Identity.Name.ToString())
End Sub

but both boxes come up empty. Do I need to include a namespace here?


I want to capture the uname and pw so I can a) log all login attempts
and b) I want to use session(pw") and session("un") as parameters in
my SQL statements to pull the corresponding records from tables.

I am pretty good at asp classic, but I am trying to teach myself
..net...it is challenging in some areas, easy in others. Any help you
could give is greatly appreciated.

ck

.



Relevant Pages

  • Re: How to pass username in the login control to next page?
    ... would access their username through their authentication typically. ... I have VB 2005, I use login control to logn in, after log in, I go to ... Protected Sub Login1_Authenticate1(ByVal sender As Object, ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: 2 questions please
    ... The login control is in the anonymous template and a staus view is in ... quest 1. ... How can I set focus to the UserName textbox of the LogIn ...
    (microsoft.public.dotnet.framework.aspnet)
  • 3 password in asp.net Login control
    ... But can't do it with Login control. ... own username and 3 password on the form. ... any method or way to undo the login process based on my internally ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Open another .aspx page
    ... specifies where to proceed on successful login. ... Microsoft MVP http://msmvps.com/blogs/egoldinhttp://usableasp.net ... I did look at the login control. ... match the username and password. ...
    (microsoft.public.dotnet.framework.aspnet)
  • ASP.NET 2 Web Login Control On Page Load
    ... I have a page with the Login Control. ... and click the enter key the page reloads without doing the ... button, but enters the username and password, do the login.authenicate? ...
    (microsoft.public.dotnet.framework.aspnet)