Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2007

Tip: Looking for answers? Try searching our database.

2 questions please

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ckerns@refuse.net - 11 Jul 2007 07:35 GMT
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
Masudur - 11 Jul 2007 09:30 GMT
On Jul 11, 12:35 pm, cke...@refuse.net 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
[quoted text clipped - 9 lines]
>
> 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
ckerns@refuse.net - 11 Jul 2007 18:06 GMT
>On Jul 11, 12:35 pm, cke...@refuse.net wrote:
>> I have a page that has a LogInView.  Inside of it is a LogIn control.
[quoted text clipped - 29 lines]
>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
Masudur - 12 Jul 2007 05:45 GMT
On Jul 11, 11:06 pm, cke...@refuse.net wrote:
> >On Jul 11, 12:35 pm, cke...@refuse.net wrote:
> >> I have a page that has a LogInView.  Inside of it is a LogIn control.
[quoted text clipped - 52 lines]
>
> 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
Cubaman - 12 Jul 2007 10:22 GMT
On Jul 11, 7:06 pm, cke...@refuse.net wrote:
> >On Jul 11, 12:35 pm, cke...@refuse.net wrote:
> >> I have a page that has a LogInView.  Inside of it is a LogIn control.
[quoted text clipped - 54 lines]
>
> - 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

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.