2 questions please

C

ckerns

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
 
M

Masudur

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
 
C

ckerns

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
 
M

Masudur

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

hi...

oh i think we are missing the point here...
you got to login first to use Page.User.Identity.Name ,
and un authenticated page have this property empty...
well i think you want to populate the username textbox for returnning
user...
in that case you got to save the username in cookie... and the use
that cookie to populate your textbox...
after log in you can save it in session ... but after the user close
the browser.,.... session will be useless... and if use again come to
visit a new session will be created... so session is usefull as log as
you remain in same site...

so bottom line is if you want to implement prepopulated usename
textbox for returnning user... use cookie to populate...

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

Cubaman

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- Hide quoted text -

- Show quoted text -

No need of javascript to do that, just add a property to your form
called defaultfocus and asign to it the name of the control you want
to focus..
<form id="form1" runat="server" defaultfocus="ctrLogin" >

Best regards,

Oscar Acosta
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top