473,323 Members | 1,547 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

Can we set focus in UserName of a LoginView

ad
I use a LoginView to authenticate user.
Can we set the focus in the UserName or Password of the LoginView?
Nov 19 '05 #1
3 1625
here is one I found and modified it for csharp:

private void SetFocusControl(String ControlName)
{
//http://www.developer.com/net/asp/article.php/2237431
//character 34 = "

String script = "<script language=\"javascript\""+
">" +
" var control = document.getElementById(\"" +
ControlName + "\");" +
" if( control != null ){control.focus();}" +
"</script>";

Page.RegisterStartupScript("Focus", script);
}

Nov 19 '05 #2
See :

http://ryanfarley.com/blog/archive/2004/12/21/1325.aspx

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"ad" <fl****@wfes.tcc.edu.tw> wrote in message
news:u3****************@TK2MSFTNGP09.phx.gbl...
I use a LoginView to authenticate user.
Can we set the focus in the UserName or Password of the LoginView?

Nov 19 '05 #3
ad
Thanks,
If the UserName control is general textbox, It can do by SetFocus or
Javascript.
But now the UserName is in LoginView.
How can I do?
"Juan T. Llibre" <no***********@nowhere.com> ¼¶¼g©ó¶l¥ó·s»D:Or**************@TK2MSFTNGP15.phx.g bl...
See :

http://ryanfarley.com/blog/archive/2004/12/21/1325.aspx

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"ad" <fl****@wfes.tcc.edu.tw> wrote in message
news:u3****************@TK2MSFTNGP09.phx.gbl...
I use a LoginView to authenticate user.
Can we set the focus in the UserName or Password of the LoginView?


Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Csaba | last post by:
I'd like to have the cursor in the login form's username input text field when users load the login page. It works fine with the following implementation: <body...
0
by: RedEye | last post by:
Hello, I have been looking for a way to add roles to a LoginView control programmatically and it's not working. I have called the sub at init and load and neither work. Does anyone know what I...
0
by: keithb | last post by:
Using Website | ASP.NET Configuration, I set up a role name Administrators and a user named admin. In my application, I put a LoginView Conrol on my master page. The LoginView control has an...
3
by: jab3 | last post by:
Hello. I"m new to this group, and to JavaScript in general, so please forgive me if I breach local etiquette. I'm trying to implement some client-side 'dynamic' validation on a form. I'm having...
1
by: Phil | last post by:
I have gridview with a templatefield in which is a loginview. The loginview displays a delete linkbutton for a specified group only. when a record is delete the loginview displays the contents of...
3
by: =?Utf-8?B?am1obWFpbmU=?= | last post by:
When I put asp controls inside the LoginView it removes the codebehind references so that the page will not build. For example: <asp:LoginView ID="LoginView" runat="server" > <LoggedInTemplate>...
8
by: Brad Isaacs | last post by:
Good morning friends, I am working with Visual Studio 2005, ASP.NET 2.0 I am working with the Login controls provided my .NET 2.0, trying to make the Login1 control UserName textbox obtain...
1
by: Morgan Cheng | last post by:
I tried to add a LoginView control in OnClick eventhandler of a button. The code is like below LoginView login = new LoginView(); PlaceHolder1.Controls.Add(login); After run the page, I...
2
by: Jeff | last post by:
Hey ASP.NET 2.0 I'm about to start programming a new website at work. My boss want's me avoid using the Membership system in ASP.NET 2.0 (probably because he don't understand how it...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.