473,385 Members | 1,610 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,385 software developers and data experts.

setfocus in web control page

Hi,

I saw the post here about setfocus. But they are for web form.

Web control page HTML does not have form1. the Jscript there does not work
here.

My question is how to set focus to the text box in web control page?
The following is the html version of the page design:

<DIV style="WIDTH: 992px; POSITION: relative; HEIGHT: 424px"
ms_positioning="GridLayout"><asp:label id="Label3" style="Z-INDEX: 103; LEFT:
344px; POSITION: absolute; TOP: 88px" ForeColor="#FF8080"
runat="server">Please login to access private content</asp:label>

<asp:textbox id="txtUserName" style="Z-INDEX: 104; LEFT: 448px; POSITION:
absolute; TOP: 144px"
runat="server"></asp:textbox><asp:label id="lblUserName" style="Z-INDEX:
105; LEFT: 280px; POSITION: absolute; TOP: 144px"
runat="server">Enter email address</asp:label><asp:label id="lblPassword"
style="Z-INDEX: 106; LEFT: 280px; POSITION: absolute; TOP: 192px"
runat="server">Enter password</asp:label><asp:textbox id="txtPassword"
style="Z-INDEX: 107; LEFT: 448px; POSITION: absolute; TOP: 192px"
runat="server" TextMode="Password"></asp:textbox><asp:button id="Button1"
style="Z-INDEX: 108; LEFT: 448px; POSITION: absolute; TOP: 240px"
runat="server"
Text="Login"></asp:button>
<asp:regularexpressionvalidator id="revUsername" style="Z-INDEX: 111; LEFT:
664px; POSITION: absolute; TOP: 144px"
runat="server" Display="Dynamic"
ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
ControlToValidate="txtUserName"
ErrorMessage="Enter the email address as :
us**@domain.com">*</asp:regularexpressionvalidator><asp:requiredfieldv alidator
id="rfvUsername" style="Z-INDEX: 112; LEFT: 728px; POSITION: absolute; TOP:
144px"
runat="server" Display="Dynamic" ControlToValidate="txtUserName"
ErrorMessage="Enter the correct user
ID"></asp:requiredfieldvalidator><asp:requiredfieldvalid ator id="rfvPassword"
style="Z-INDEX: 113; LEFT: 728px; POSITION: absolute; TOP: 192px"
runat="server" Display="Dynamic" ControlToValidate="txtPassword"
ErrorMessage="Enter the correct
password"></asp:requiredfieldvalidator><asp:validationsummary
id="ValidationSummary1" style="Z-INDEX: 114; LEFT: 440px; POSITION: absolute;
TOP: 288px"
Width="364px" runat="server" HeaderText="Please correct the
followings:"></asp:validationsummary><asp:label id="lblSuccess"
style="Z-INDEX: 115; LEFT: 544px; POSITION: absolute; TOP: 240px"
runat="server"></asp:label></DIV>

Thanks. -Dale

Nov 17 '05 #1
10 1892
Hi,

Your code is not well formatted and very difficult to read,
It's very easy, you have to get the clientID of the control to gets the
focus, include a javascript code with it and on the onLoad event fire it.

In the aspx page:

<script>
var controlToFocus ='';
function OnLoadHandler()
{
if ( controlToFocus != "" )
document.all[controlToFocus].focus();
}
</script>

<body onload="OnLoadHandler();">
In the code behind:

this.Controls.Add( LiteralControl( "<script>controlToFocus ='" +
theControl.ClientID + " ';</script>" );
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


"dale zhang" <da*******@discussions.microsoft.com> wrote in message
news:CB**********************************@microsof t.com...
Hi,

I saw the post here about setfocus. But they are for web form.

Web control page HTML does not have form1. the Jscript there does not work
here.

My question is how to set focus to the text box in web control page?
The following is the html version of the page design:

<DIV style="WIDTH: 992px; POSITION: relative; HEIGHT: 424px"
ms_positioning="GridLayout"><asp:label id="Label3" style="Z-INDEX: 103;
LEFT:
344px; POSITION: absolute; TOP: 88px" ForeColor="#FF8080"
runat="server">Please login to access private content</asp:label>

<asp:textbox id="txtUserName" style="Z-INDEX: 104; LEFT: 448px; POSITION:
absolute; TOP: 144px"
runat="server"></asp:textbox><asp:label id="lblUserName" style="Z-INDEX:
105; LEFT: 280px; POSITION: absolute; TOP: 144px"
runat="server">Enter email address</asp:label><asp:label id="lblPassword"
style="Z-INDEX: 106; LEFT: 280px; POSITION: absolute; TOP: 192px"
runat="server">Enter password</asp:label><asp:textbox id="txtPassword"
style="Z-INDEX: 107; LEFT: 448px; POSITION: absolute; TOP: 192px"
runat="server" TextMode="Password"></asp:textbox><asp:button id="Button1"
style="Z-INDEX: 108; LEFT: 448px; POSITION: absolute; TOP: 240px"
runat="server"
Text="Login"></asp:button>
<asp:regularexpressionvalidator id="revUsername" style="Z-INDEX: 111;
LEFT:
664px; POSITION: absolute; TOP: 144px"
runat="server" Display="Dynamic"
ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
ControlToValidate="txtUserName"
ErrorMessage="Enter the email address as :
us**@domain.com">*</asp:regularexpressionvalidator><asp:requiredfieldv alidator
id="rfvUsername" style="Z-INDEX: 112; LEFT: 728px; POSITION: absolute;
TOP:
144px"
runat="server" Display="Dynamic" ControlToValidate="txtUserName"
ErrorMessage="Enter the correct user
ID"></asp:requiredfieldvalidator><asp:requiredfieldvalid ator
id="rfvPassword"
style="Z-INDEX: 113; LEFT: 728px; POSITION: absolute; TOP: 192px"
runat="server" Display="Dynamic" ControlToValidate="txtPassword"
ErrorMessage="Enter the correct
password"></asp:requiredfieldvalidator><asp:validationsummary
id="ValidationSummary1" style="Z-INDEX: 114; LEFT: 440px; POSITION:
absolute;
TOP: 288px"
Width="364px" runat="server" HeaderText="Please correct the
followings:"></asp:validationsummary><asp:label id="lblSuccess"
style="Z-INDEX: 115; LEFT: 544px; POSITION: absolute; TOP: 240px"
runat="server"></asp:label></DIV>

Thanks. -Dale

Nov 17 '05 #2
Hi,

Thank you for your help. I guess the clientID is txtUserName.

But the element 'body' can not be nested within 'DIV'.

So this does not compile.

Any idea? -Dale

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,

Your code is not well formatted and very difficult to read,
It's very easy, you have to get the clientID of the control to gets the
focus, include a javascript code with it and on the onLoad event fire it.

In the aspx page:

<script>
var controlToFocus ='';
function OnLoadHandler()
{
if ( controlToFocus != "" )
document.all[controlToFocus].focus();
}
</script>

<body onload="OnLoadHandler();">
In the code behind:

this.Controls.Add( LiteralControl( "<script>controlToFocus ='" +
theControl.ClientID + " ';</script>" );
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


"dale zhang" <da*******@discussions.microsoft.com> wrote in message
news:CB**********************************@microsof t.com...
Hi,

I saw the post here about setfocus. But they are for web form.

Web control page HTML does not have form1. the Jscript there does not work
here.

My question is how to set focus to the text box in web control page?
The following is the html version of the page design:

<DIV style="WIDTH: 992px; POSITION: relative; HEIGHT: 424px"
ms_positioning="GridLayout"><asp:label id="Label3" style="Z-INDEX: 103;
LEFT:
344px; POSITION: absolute; TOP: 88px" ForeColor="#FF8080"
runat="server">Please login to access private content</asp:label>

<asp:textbox id="txtUserName" style="Z-INDEX: 104; LEFT: 448px; POSITION:
absolute; TOP: 144px"
runat="server"></asp:textbox><asp:label id="lblUserName" style="Z-INDEX:
105; LEFT: 280px; POSITION: absolute; TOP: 144px"
runat="server">Enter email address</asp:label><asp:label id="lblPassword"
style="Z-INDEX: 106; LEFT: 280px; POSITION: absolute; TOP: 192px"
runat="server">Enter password</asp:label><asp:textbox id="txtPassword"
style="Z-INDEX: 107; LEFT: 448px; POSITION: absolute; TOP: 192px"
runat="server" TextMode="Password"></asp:textbox><asp:button id="Button1"
style="Z-INDEX: 108; LEFT: 448px; POSITION: absolute; TOP: 240px"
runat="server"
Text="Login"></asp:button>
<asp:regularexpressionvalidator id="revUsername" style="Z-INDEX: 111;
LEFT:
664px; POSITION: absolute; TOP: 144px"
runat="server" Display="Dynamic"
ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
ControlToValidate="txtUserName"
ErrorMessage="Enter the email address as :
us**@domain.com">*</asp:regularexpressionvalidator><asp:requiredfieldv alidator
id="rfvUsername" style="Z-INDEX: 112; LEFT: 728px; POSITION: absolute;
TOP:
144px"
runat="server" Display="Dynamic" ControlToValidate="txtUserName"
ErrorMessage="Enter the correct user
ID"></asp:requiredfieldvalidator><asp:requiredfieldvalid ator
id="rfvPassword"
style="Z-INDEX: 113; LEFT: 728px; POSITION: absolute; TOP: 192px"
runat="server" Display="Dynamic" ControlToValidate="txtPassword"
ErrorMessage="Enter the correct
password"></asp:requiredfieldvalidator><asp:validationsummary
id="ValidationSummary1" style="Z-INDEX: 114; LEFT: 440px; POSITION:
absolute;
TOP: 288px"
Width="364px" runat="server" HeaderText="Please correct the
followings:"></asp:validationsummary><asp:label id="lblSuccess"
style="Z-INDEX: 115; LEFT: 544px; POSITION: absolute; TOP: 240px"
runat="server"></asp:label></DIV>

Thanks. -Dale


Nov 17 '05 #3
Hi,

Thank you for your help. I guess the clientID is txtUserName.

But the element 'body' can not be nested within 'DIV'.

So this does not compile.

Any idea? -Dale

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,

Your code is not well formatted and very difficult to read,
It's very easy, you have to get the clientID of the control to gets the
focus, include a javascript code with it and on the onLoad event fire it.

In the aspx page:

<script>
var controlToFocus ='';
function OnLoadHandler()
{
if ( controlToFocus != "" )
document.all[controlToFocus].focus();
}
</script>

<body onload="OnLoadHandler();">
In the code behind:

this.Controls.Add( LiteralControl( "<script>controlToFocus ='" +
theControl.ClientID + " ';</script>" );
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


"dale zhang" <da*******@discussions.microsoft.com> wrote in message
news:CB**********************************@microsof t.com...
Hi,

I saw the post here about setfocus. But they are for web form.

Web control page HTML does not have form1. the Jscript there does not work
here.

My question is how to set focus to the text box in web control page?
The following is the html version of the page design:

<DIV style="WIDTH: 992px; POSITION: relative; HEIGHT: 424px"
ms_positioning="GridLayout"><asp:label id="Label3" style="Z-INDEX: 103;
LEFT:
344px; POSITION: absolute; TOP: 88px" ForeColor="#FF8080"
runat="server">Please login to access private content</asp:label>

<asp:textbox id="txtUserName" style="Z-INDEX: 104; LEFT: 448px; POSITION:
absolute; TOP: 144px"
runat="server"></asp:textbox><asp:label id="lblUserName" style="Z-INDEX:
105; LEFT: 280px; POSITION: absolute; TOP: 144px"
runat="server">Enter email address</asp:label><asp:label id="lblPassword"
style="Z-INDEX: 106; LEFT: 280px; POSITION: absolute; TOP: 192px"
runat="server">Enter password</asp:label><asp:textbox id="txtPassword"
style="Z-INDEX: 107; LEFT: 448px; POSITION: absolute; TOP: 192px"
runat="server" TextMode="Password"></asp:textbox><asp:button id="Button1"
style="Z-INDEX: 108; LEFT: 448px; POSITION: absolute; TOP: 240px"
runat="server"
Text="Login"></asp:button>
<asp:regularexpressionvalidator id="revUsername" style="Z-INDEX: 111;
LEFT:
664px; POSITION: absolute; TOP: 144px"
runat="server" Display="Dynamic"
ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
ControlToValidate="txtUserName"
ErrorMessage="Enter the email address as :
us**@domain.com">*</asp:regularexpressionvalidator><asp:requiredfieldv alidator
id="rfvUsername" style="Z-INDEX: 112; LEFT: 728px; POSITION: absolute;
TOP:
144px"
runat="server" Display="Dynamic" ControlToValidate="txtUserName"
ErrorMessage="Enter the correct user
ID"></asp:requiredfieldvalidator><asp:requiredfieldvalid ator
id="rfvPassword"
style="Z-INDEX: 113; LEFT: 728px; POSITION: absolute; TOP: 192px"
runat="server" Display="Dynamic" ControlToValidate="txtPassword"
ErrorMessage="Enter the correct
password"></asp:requiredfieldvalidator><asp:validationsummary
id="ValidationSummary1" style="Z-INDEX: 114; LEFT: 440px; POSITION:
absolute;
TOP: 288px"
Width="364px" runat="server" HeaderText="Please correct the
followings:"></asp:validationsummary><asp:label id="lblSuccess"
style="Z-INDEX: 115; LEFT: 544px; POSITION: absolute; TOP: 240px"
runat="server"></asp:label></DIV>

Thanks. -Dale


Nov 17 '05 #4
Hi,

It does compile indeed, as a matter of fact, the only line you have to
include in the code behind (the one which gets compiled) is the Controls.Add

<body> is the tag that start the page, all aspx pages have one, why are you
including it inside a DIV ?
There is only one <body> in your page, just add the onload event to the one
you have.

also the script part can be placed at any place, it's just customary to
place it in the header.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"dale zhang" <da*******@discussions.microsoft.com> wrote in message
news:0D**********************************@microsof t.com...
Hi,

Thank you for your help. I guess the clientID is txtUserName.

But the element 'body' can not be nested within 'DIV'.

So this does not compile.

Any idea? -Dale

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,

Your code is not well formatted and very difficult to read,
It's very easy, you have to get the clientID of the control to gets the
focus, include a javascript code with it and on the onLoad event fire it.

In the aspx page:

<script>
var controlToFocus ='';
function OnLoadHandler()
{
if ( controlToFocus != "" )
document.all[controlToFocus].focus();
}
</script>

<body onload="OnLoadHandler();">
In the code behind:

this.Controls.Add( LiteralControl( "<script>controlToFocus ='" +
theControl.ClientID + " ';</script>" );
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


"dale zhang" <da*******@discussions.microsoft.com> wrote in message
news:CB**********************************@microsof t.com...
> Hi,
>
> I saw the post here about setfocus. But they are for web form.
>
> Web control page HTML does not have form1. the Jscript there does not
> work
> here.
>
> My question is how to set focus to the text box in web control page?
>
>
> The following is the html version of the page design:
>
> <DIV style="WIDTH: 992px; POSITION: relative; HEIGHT: 424px"
> ms_positioning="GridLayout"><asp:label id="Label3" style="Z-INDEX: 103;
> LEFT:
> 344px; POSITION: absolute; TOP: 88px" ForeColor="#FF8080"
> runat="server">Please login to access private content</asp:label>
>
> <asp:textbox id="txtUserName" style="Z-INDEX: 104; LEFT: 448px;
> POSITION:
> absolute; TOP: 144px"
> runat="server"></asp:textbox><asp:label id="lblUserName"
> style="Z-INDEX:
> 105; LEFT: 280px; POSITION: absolute; TOP: 144px"
> runat="server">Enter email address</asp:label><asp:label
> id="lblPassword"
> style="Z-INDEX: 106; LEFT: 280px; POSITION: absolute; TOP: 192px"
> runat="server">Enter password</asp:label><asp:textbox id="txtPassword"
> style="Z-INDEX: 107; LEFT: 448px; POSITION: absolute; TOP: 192px"
> runat="server" TextMode="Password"></asp:textbox><asp:button
> id="Button1"
> style="Z-INDEX: 108; LEFT: 448px; POSITION: absolute; TOP: 240px"
> runat="server"
> Text="Login"></asp:button>
> <asp:regularexpressionvalidator id="revUsername" style="Z-INDEX: 111;
> LEFT:
> 664px; POSITION: absolute; TOP: 144px"
> runat="server" Display="Dynamic"
> ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
> ControlToValidate="txtUserName"
> ErrorMessage="Enter the email address as :
> us**@domain.com">*</asp:regularexpressionvalidator><asp:requiredfieldv alidator
> id="rfvUsername" style="Z-INDEX: 112; LEFT: 728px; POSITION: absolute;
> TOP:
> 144px"
> runat="server" Display="Dynamic" ControlToValidate="txtUserName"
> ErrorMessage="Enter the correct user
> ID"></asp:requiredfieldvalidator><asp:requiredfieldvalid ator
> id="rfvPassword"
> style="Z-INDEX: 113; LEFT: 728px; POSITION: absolute; TOP: 192px"
> runat="server" Display="Dynamic" ControlToValidate="txtPassword"
> ErrorMessage="Enter the correct
> password"></asp:requiredfieldvalidator><asp:validationsummary
> id="ValidationSummary1" style="Z-INDEX: 114; LEFT: 440px; POSITION:
> absolute;
> TOP: 288px"
> Width="364px" runat="server" HeaderText="Please correct the
> followings:"></asp:validationsummary><asp:label id="lblSuccess"
> style="Z-INDEX: 115; LEFT: 544px; POSITION: absolute; TOP: 240px"
> runat="server"></asp:label></DIV>
>
> Thanks. -Dale
>


Nov 17 '05 #5
Hi,

It does compile indeed, as a matter of fact, the only line you have to
include in the code behind (the one which gets compiled) is the Controls.Add

<body> is the tag that start the page, all aspx pages have one, why are you
including it inside a DIV ?
There is only one <body> in your page, just add the onload event to the one
you have.

also the script part can be placed at any place, it's just customary to
place it in the header.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"dale zhang" <da*******@discussions.microsoft.com> wrote in message
news:0D**********************************@microsof t.com...
Hi,

Thank you for your help. I guess the clientID is txtUserName.

But the element 'body' can not be nested within 'DIV'.

So this does not compile.

Any idea? -Dale

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,

Your code is not well formatted and very difficult to read,
It's very easy, you have to get the clientID of the control to gets the
focus, include a javascript code with it and on the onLoad event fire it.

In the aspx page:

<script>
var controlToFocus ='';
function OnLoadHandler()
{
if ( controlToFocus != "" )
document.all[controlToFocus].focus();
}
</script>

<body onload="OnLoadHandler();">
In the code behind:

this.Controls.Add( LiteralControl( "<script>controlToFocus ='" +
theControl.ClientID + " ';</script>" );
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


"dale zhang" <da*******@discussions.microsoft.com> wrote in message
news:CB**********************************@microsof t.com...
> Hi,
>
> I saw the post here about setfocus. But they are for web form.
>
> Web control page HTML does not have form1. the Jscript there does not
> work
> here.
>
> My question is how to set focus to the text box in web control page?
>
>
> The following is the html version of the page design:
>
> <DIV style="WIDTH: 992px; POSITION: relative; HEIGHT: 424px"
> ms_positioning="GridLayout"><asp:label id="Label3" style="Z-INDEX: 103;
> LEFT:
> 344px; POSITION: absolute; TOP: 88px" ForeColor="#FF8080"
> runat="server">Please login to access private content</asp:label>
>
> <asp:textbox id="txtUserName" style="Z-INDEX: 104; LEFT: 448px;
> POSITION:
> absolute; TOP: 144px"
> runat="server"></asp:textbox><asp:label id="lblUserName"
> style="Z-INDEX:
> 105; LEFT: 280px; POSITION: absolute; TOP: 144px"
> runat="server">Enter email address</asp:label><asp:label
> id="lblPassword"
> style="Z-INDEX: 106; LEFT: 280px; POSITION: absolute; TOP: 192px"
> runat="server">Enter password</asp:label><asp:textbox id="txtPassword"
> style="Z-INDEX: 107; LEFT: 448px; POSITION: absolute; TOP: 192px"
> runat="server" TextMode="Password"></asp:textbox><asp:button
> id="Button1"
> style="Z-INDEX: 108; LEFT: 448px; POSITION: absolute; TOP: 240px"
> runat="server"
> Text="Login"></asp:button>
> <asp:regularexpressionvalidator id="revUsername" style="Z-INDEX: 111;
> LEFT:
> 664px; POSITION: absolute; TOP: 144px"
> runat="server" Display="Dynamic"
> ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
> ControlToValidate="txtUserName"
> ErrorMessage="Enter the email address as :
> us**@domain.com">*</asp:regularexpressionvalidator><asp:requiredfieldv alidator
> id="rfvUsername" style="Z-INDEX: 112; LEFT: 728px; POSITION: absolute;
> TOP:
> 144px"
> runat="server" Display="Dynamic" ControlToValidate="txtUserName"
> ErrorMessage="Enter the correct user
> ID"></asp:requiredfieldvalidator><asp:requiredfieldvalid ator
> id="rfvPassword"
> style="Z-INDEX: 113; LEFT: 728px; POSITION: absolute; TOP: 192px"
> runat="server" Display="Dynamic" ControlToValidate="txtPassword"
> ErrorMessage="Enter the correct
> password"></asp:requiredfieldvalidator><asp:validationsummary
> id="ValidationSummary1" style="Z-INDEX: 114; LEFT: 440px; POSITION:
> absolute;
> TOP: 288px"
> Width="364px" runat="server" HeaderText="Please correct the
> followings:"></asp:validationsummary><asp:label id="lblSuccess"
> style="Z-INDEX: 115; LEFT: 544px; POSITION: absolute; TOP: 240px"
> runat="server"></asp:label></DIV>
>
> Thanks. -Dale
>


Nov 17 '05 #6
Hi,

Sorry, web control page does have <body>, <form1> ...

It is different from other web forms.

that is why i have troubles.

thanks anyway. -dale

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,

It does compile indeed, as a matter of fact, the only line you have to
include in the code behind (the one which gets compiled) is the Controls.Add

<body> is the tag that start the page, all aspx pages have one, why are you
including it inside a DIV ?
There is only one <body> in your page, just add the onload event to the one
you have.

also the script part can be placed at any place, it's just customary to
place it in the header.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"dale zhang" <da*******@discussions.microsoft.com> wrote in message
news:0D**********************************@microsof t.com...
Hi,

Thank you for your help. I guess the clientID is txtUserName.

But the element 'body' can not be nested within 'DIV'.

So this does not compile.

Any idea? -Dale

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,

Your code is not well formatted and very difficult to read,
It's very easy, you have to get the clientID of the control to gets the
focus, include a javascript code with it and on the onLoad event fire it.

In the aspx page:

<script>
var controlToFocus ='';
function OnLoadHandler()
{
if ( controlToFocus != "" )
document.all[controlToFocus].focus();
}
</script>

<body onload="OnLoadHandler();">
In the code behind:

this.Controls.Add( LiteralControl( "<script>controlToFocus ='" +
theControl.ClientID + " ';</script>" );
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


"dale zhang" <da*******@discussions.microsoft.com> wrote in message
news:CB**********************************@microsof t.com...
> Hi,
>
> I saw the post here about setfocus. But they are for web form.
>
> Web control page HTML does not have form1. the Jscript there does not
> work
> here.
>
> My question is how to set focus to the text box in web control page?
>
>
> The following is the html version of the page design:
>
> <DIV style="WIDTH: 992px; POSITION: relative; HEIGHT: 424px"
> ms_positioning="GridLayout"><asp:label id="Label3" style="Z-INDEX: 103;
> LEFT:
> 344px; POSITION: absolute; TOP: 88px" ForeColor="#FF8080"
> runat="server">Please login to access private content</asp:label>
>
> <asp:textbox id="txtUserName" style="Z-INDEX: 104; LEFT: 448px;
> POSITION:
> absolute; TOP: 144px"
> runat="server"></asp:textbox><asp:label id="lblUserName"
> style="Z-INDEX:
> 105; LEFT: 280px; POSITION: absolute; TOP: 144px"
> runat="server">Enter email address</asp:label><asp:label
> id="lblPassword"
> style="Z-INDEX: 106; LEFT: 280px; POSITION: absolute; TOP: 192px"
> runat="server">Enter password</asp:label><asp:textbox id="txtPassword"
> style="Z-INDEX: 107; LEFT: 448px; POSITION: absolute; TOP: 192px"
> runat="server" TextMode="Password"></asp:textbox><asp:button
> id="Button1"
> style="Z-INDEX: 108; LEFT: 448px; POSITION: absolute; TOP: 240px"
> runat="server"
> Text="Login"></asp:button>
> <asp:regularexpressionvalidator id="revUsername" style="Z-INDEX: 111;
> LEFT:
> 664px; POSITION: absolute; TOP: 144px"
> runat="server" Display="Dynamic"
> ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
> ControlToValidate="txtUserName"
> ErrorMessage="Enter the email address as :
> us**@domain.com">*</asp:regularexpressionvalidator><asp:requiredfieldv alidator
> id="rfvUsername" style="Z-INDEX: 112; LEFT: 728px; POSITION: absolute;
> TOP:
> 144px"
> runat="server" Display="Dynamic" ControlToValidate="txtUserName"
> ErrorMessage="Enter the correct user
> ID"></asp:requiredfieldvalidator><asp:requiredfieldvalid ator
> id="rfvPassword"
> style="Z-INDEX: 113; LEFT: 728px; POSITION: absolute; TOP: 192px"
> runat="server" Display="Dynamic" ControlToValidate="txtPassword"
> ErrorMessage="Enter the correct
> password"></asp:requiredfieldvalidator><asp:validationsummary
> id="ValidationSummary1" style="Z-INDEX: 114; LEFT: 440px; POSITION:
> absolute;
> TOP: 288px"
> Width="364px" runat="server" HeaderText="Please correct the
> followings:"></asp:validationsummary><asp:label id="lblSuccess"
> style="Z-INDEX: 115; LEFT: 544px; POSITION: absolute; TOP: 240px"
> runat="server"></asp:label></DIV>
>
> Thanks. -Dale
>


Nov 17 '05 #7
Hi,

Sorry, web control page does have <body>, <form1> ...

It is different from other web forms.

that is why i have troubles.

thanks anyway. -dale

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,

It does compile indeed, as a matter of fact, the only line you have to
include in the code behind (the one which gets compiled) is the Controls.Add

<body> is the tag that start the page, all aspx pages have one, why are you
including it inside a DIV ?
There is only one <body> in your page, just add the onload event to the one
you have.

also the script part can be placed at any place, it's just customary to
place it in the header.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"dale zhang" <da*******@discussions.microsoft.com> wrote in message
news:0D**********************************@microsof t.com...
Hi,

Thank you for your help. I guess the clientID is txtUserName.

But the element 'body' can not be nested within 'DIV'.

So this does not compile.

Any idea? -Dale

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,

Your code is not well formatted and very difficult to read,
It's very easy, you have to get the clientID of the control to gets the
focus, include a javascript code with it and on the onLoad event fire it.

In the aspx page:

<script>
var controlToFocus ='';
function OnLoadHandler()
{
if ( controlToFocus != "" )
document.all[controlToFocus].focus();
}
</script>

<body onload="OnLoadHandler();">
In the code behind:

this.Controls.Add( LiteralControl( "<script>controlToFocus ='" +
theControl.ClientID + " ';</script>" );
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


"dale zhang" <da*******@discussions.microsoft.com> wrote in message
news:CB**********************************@microsof t.com...
> Hi,
>
> I saw the post here about setfocus. But they are for web form.
>
> Web control page HTML does not have form1. the Jscript there does not
> work
> here.
>
> My question is how to set focus to the text box in web control page?
>
>
> The following is the html version of the page design:
>
> <DIV style="WIDTH: 992px; POSITION: relative; HEIGHT: 424px"
> ms_positioning="GridLayout"><asp:label id="Label3" style="Z-INDEX: 103;
> LEFT:
> 344px; POSITION: absolute; TOP: 88px" ForeColor="#FF8080"
> runat="server">Please login to access private content</asp:label>
>
> <asp:textbox id="txtUserName" style="Z-INDEX: 104; LEFT: 448px;
> POSITION:
> absolute; TOP: 144px"
> runat="server"></asp:textbox><asp:label id="lblUserName"
> style="Z-INDEX:
> 105; LEFT: 280px; POSITION: absolute; TOP: 144px"
> runat="server">Enter email address</asp:label><asp:label
> id="lblPassword"
> style="Z-INDEX: 106; LEFT: 280px; POSITION: absolute; TOP: 192px"
> runat="server">Enter password</asp:label><asp:textbox id="txtPassword"
> style="Z-INDEX: 107; LEFT: 448px; POSITION: absolute; TOP: 192px"
> runat="server" TextMode="Password"></asp:textbox><asp:button
> id="Button1"
> style="Z-INDEX: 108; LEFT: 448px; POSITION: absolute; TOP: 240px"
> runat="server"
> Text="Login"></asp:button>
> <asp:regularexpressionvalidator id="revUsername" style="Z-INDEX: 111;
> LEFT:
> 664px; POSITION: absolute; TOP: 144px"
> runat="server" Display="Dynamic"
> ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
> ControlToValidate="txtUserName"
> ErrorMessage="Enter the email address as :
> us**@domain.com">*</asp:regularexpressionvalidator><asp:requiredfieldv alidator
> id="rfvUsername" style="Z-INDEX: 112; LEFT: 728px; POSITION: absolute;
> TOP:
> 144px"
> runat="server" Display="Dynamic" ControlToValidate="txtUserName"
> ErrorMessage="Enter the correct user
> ID"></asp:requiredfieldvalidator><asp:requiredfieldvalid ator
> id="rfvPassword"
> style="Z-INDEX: 113; LEFT: 728px; POSITION: absolute; TOP: 192px"
> runat="server" Display="Dynamic" ControlToValidate="txtPassword"
> ErrorMessage="Enter the correct
> password"></asp:requiredfieldvalidator><asp:validationsummary
> id="ValidationSummary1" style="Z-INDEX: 114; LEFT: 440px; POSITION:
> absolute;
> TOP: 288px"
> Width="364px" runat="server" HeaderText="Please correct the
> followings:"></asp:validationsummary><asp:label id="lblSuccess"
> style="Z-INDEX: 115; LEFT: 544px; POSITION: absolute; TOP: 240px"
> runat="server"></asp:label></DIV>
>
> Thanks. -Dale
>


Nov 17 '05 #8
Hi Dale,

I'm completely lost now, do you have problems or not?

The page will have only one <body >

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"dale zhang" <da*******@discussions.microsoft.com> wrote in message
news:79**********************************@microsof t.com...
Hi,

Sorry, web control page does have <body>, <form1> ...

It is different from other web forms.

that is why i have troubles.

thanks anyway. -dale

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,

It does compile indeed, as a matter of fact, the only line you have to
include in the code behind (the one which gets compiled) is the
Controls.Add

<body> is the tag that start the page, all aspx pages have one, why are
you
including it inside a DIV ?
There is only one <body> in your page, just add the onload event to the
one
you have.

also the script part can be placed at any place, it's just customary to
place it in the header.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"dale zhang" <da*******@discussions.microsoft.com> wrote in message
news:0D**********************************@microsof t.com...
> Hi,
>
> Thank you for your help. I guess the clientID is txtUserName.
>
> But the element 'body' can not be nested within 'DIV'.
>
> So this does not compile.
>
> Any idea? -Dale
>
> "Ignacio Machin ( .NET/ C# MVP )" wrote:
>
>> Hi,
>>
>> Your code is not well formatted and very difficult to read,
>> It's very easy, you have to get the clientID of the control to gets
>> the
>> focus, include a javascript code with it and on the onLoad event fire
>> it.
>>
>> In the aspx page:
>>
>> <script>
>> var controlToFocus ='';
>> function OnLoadHandler()
>> {
>> if ( controlToFocus != "" )
>> document.all[controlToFocus].focus();
>> }
>> </script>
>>
>> <body onload="OnLoadHandler();">
>>
>>
>> In the code behind:
>>
>> this.Controls.Add( LiteralControl( "<script>controlToFocus ='" +
>> theControl.ClientID + " ';</script>" );
>>
>>
>> Cheers,
>>
>> --
>> Ignacio Machin,
>> ignacio.machin AT dot.state.fl.us
>> Florida Department Of Transportation
>>
>>
>>
>>
>> "dale zhang" <da*******@discussions.microsoft.com> wrote in message
>> news:CB**********************************@microsof t.com...
>> > Hi,
>> >
>> > I saw the post here about setfocus. But they are for web form.
>> >
>> > Web control page HTML does not have form1. the Jscript there does
>> > not
>> > work
>> > here.
>> >
>> > My question is how to set focus to the text box in web control page?
>> >
>> >
>> > The following is the html version of the page design:
>> >
>> > <DIV style="WIDTH: 992px; POSITION: relative; HEIGHT: 424px"
>> > ms_positioning="GridLayout"><asp:label id="Label3" style="Z-INDEX:
>> > 103;
>> > LEFT:
>> > 344px; POSITION: absolute; TOP: 88px" ForeColor="#FF8080"
>> > runat="server">Please login to access private content</asp:label>
>> >
>> > <asp:textbox id="txtUserName" style="Z-INDEX: 104; LEFT: 448px;
>> > POSITION:
>> > absolute; TOP: 144px"
>> > runat="server"></asp:textbox><asp:label id="lblUserName"
>> > style="Z-INDEX:
>> > 105; LEFT: 280px; POSITION: absolute; TOP: 144px"
>> > runat="server">Enter email address</asp:label><asp:label
>> > id="lblPassword"
>> > style="Z-INDEX: 106; LEFT: 280px; POSITION: absolute; TOP: 192px"
>> > runat="server">Enter password</asp:label><asp:textbox
>> > id="txtPassword"
>> > style="Z-INDEX: 107; LEFT: 448px; POSITION: absolute; TOP: 192px"
>> > runat="server" TextMode="Password"></asp:textbox><asp:button
>> > id="Button1"
>> > style="Z-INDEX: 108; LEFT: 448px; POSITION: absolute; TOP: 240px"
>> > runat="server"
>> > Text="Login"></asp:button>
>> > <asp:regularexpressionvalidator id="revUsername" style="Z-INDEX:
>> > 111;
>> > LEFT:
>> > 664px; POSITION: absolute; TOP: 144px"
>> > runat="server" Display="Dynamic"
>> > ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
>> > ControlToValidate="txtUserName"
>> > ErrorMessage="Enter the email address as :
>> > us**@domain.com">*</asp:regularexpressionvalidator><asp:requiredfieldv alidator
>> > id="rfvUsername" style="Z-INDEX: 112; LEFT: 728px; POSITION:
>> > absolute;
>> > TOP:
>> > 144px"
>> > runat="server" Display="Dynamic" ControlToValidate="txtUserName"
>> > ErrorMessage="Enter the correct user
>> > ID"></asp:requiredfieldvalidator><asp:requiredfieldvalid ator
>> > id="rfvPassword"
>> > style="Z-INDEX: 113; LEFT: 728px; POSITION: absolute; TOP: 192px"
>> > runat="server" Display="Dynamic" ControlToValidate="txtPassword"
>> > ErrorMessage="Enter the correct
>> > password"></asp:requiredfieldvalidator><asp:validationsummary
>> > id="ValidationSummary1" style="Z-INDEX: 114; LEFT: 440px; POSITION:
>> > absolute;
>> > TOP: 288px"
>> > Width="364px" runat="server" HeaderText="Please correct the
>> > followings:"></asp:validationsummary><asp:label id="lblSuccess"
>> > style="Z-INDEX: 115; LEFT: 544px; POSITION: absolute; TOP: 240px"
>> > runat="server"></asp:label></DIV>
>> >
>> > Thanks. -Dale
>> >
>>
>>
>>


Nov 17 '05 #9
Hi Dale,

I'm completely lost now, do you have problems or not?

The page will have only one <body >

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"dale zhang" <da*******@discussions.microsoft.com> wrote in message
news:79**********************************@microsof t.com...
Hi,

Sorry, web control page does have <body>, <form1> ...

It is different from other web forms.

that is why i have troubles.

thanks anyway. -dale

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,

It does compile indeed, as a matter of fact, the only line you have to
include in the code behind (the one which gets compiled) is the
Controls.Add

<body> is the tag that start the page, all aspx pages have one, why are
you
including it inside a DIV ?
There is only one <body> in your page, just add the onload event to the
one
you have.

also the script part can be placed at any place, it's just customary to
place it in the header.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"dale zhang" <da*******@discussions.microsoft.com> wrote in message
news:0D**********************************@microsof t.com...
> Hi,
>
> Thank you for your help. I guess the clientID is txtUserName.
>
> But the element 'body' can not be nested within 'DIV'.
>
> So this does not compile.
>
> Any idea? -Dale
>
> "Ignacio Machin ( .NET/ C# MVP )" wrote:
>
>> Hi,
>>
>> Your code is not well formatted and very difficult to read,
>> It's very easy, you have to get the clientID of the control to gets
>> the
>> focus, include a javascript code with it and on the onLoad event fire
>> it.
>>
>> In the aspx page:
>>
>> <script>
>> var controlToFocus ='';
>> function OnLoadHandler()
>> {
>> if ( controlToFocus != "" )
>> document.all[controlToFocus].focus();
>> }
>> </script>
>>
>> <body onload="OnLoadHandler();">
>>
>>
>> In the code behind:
>>
>> this.Controls.Add( LiteralControl( "<script>controlToFocus ='" +
>> theControl.ClientID + " ';</script>" );
>>
>>
>> Cheers,
>>
>> --
>> Ignacio Machin,
>> ignacio.machin AT dot.state.fl.us
>> Florida Department Of Transportation
>>
>>
>>
>>
>> "dale zhang" <da*******@discussions.microsoft.com> wrote in message
>> news:CB**********************************@microsof t.com...
>> > Hi,
>> >
>> > I saw the post here about setfocus. But they are for web form.
>> >
>> > Web control page HTML does not have form1. the Jscript there does
>> > not
>> > work
>> > here.
>> >
>> > My question is how to set focus to the text box in web control page?
>> >
>> >
>> > The following is the html version of the page design:
>> >
>> > <DIV style="WIDTH: 992px; POSITION: relative; HEIGHT: 424px"
>> > ms_positioning="GridLayout"><asp:label id="Label3" style="Z-INDEX:
>> > 103;
>> > LEFT:
>> > 344px; POSITION: absolute; TOP: 88px" ForeColor="#FF8080"
>> > runat="server">Please login to access private content</asp:label>
>> >
>> > <asp:textbox id="txtUserName" style="Z-INDEX: 104; LEFT: 448px;
>> > POSITION:
>> > absolute; TOP: 144px"
>> > runat="server"></asp:textbox><asp:label id="lblUserName"
>> > style="Z-INDEX:
>> > 105; LEFT: 280px; POSITION: absolute; TOP: 144px"
>> > runat="server">Enter email address</asp:label><asp:label
>> > id="lblPassword"
>> > style="Z-INDEX: 106; LEFT: 280px; POSITION: absolute; TOP: 192px"
>> > runat="server">Enter password</asp:label><asp:textbox
>> > id="txtPassword"
>> > style="Z-INDEX: 107; LEFT: 448px; POSITION: absolute; TOP: 192px"
>> > runat="server" TextMode="Password"></asp:textbox><asp:button
>> > id="Button1"
>> > style="Z-INDEX: 108; LEFT: 448px; POSITION: absolute; TOP: 240px"
>> > runat="server"
>> > Text="Login"></asp:button>
>> > <asp:regularexpressionvalidator id="revUsername" style="Z-INDEX:
>> > 111;
>> > LEFT:
>> > 664px; POSITION: absolute; TOP: 144px"
>> > runat="server" Display="Dynamic"
>> > ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
>> > ControlToValidate="txtUserName"
>> > ErrorMessage="Enter the email address as :
>> > us**@domain.com">*</asp:regularexpressionvalidator><asp:requiredfieldv alidator
>> > id="rfvUsername" style="Z-INDEX: 112; LEFT: 728px; POSITION:
>> > absolute;
>> > TOP:
>> > 144px"
>> > runat="server" Display="Dynamic" ControlToValidate="txtUserName"
>> > ErrorMessage="Enter the correct user
>> > ID"></asp:requiredfieldvalidator><asp:requiredfieldvalid ator
>> > id="rfvPassword"
>> > style="Z-INDEX: 113; LEFT: 728px; POSITION: absolute; TOP: 192px"
>> > runat="server" Display="Dynamic" ControlToValidate="txtPassword"
>> > ErrorMessage="Enter the correct
>> > password"></asp:requiredfieldvalidator><asp:validationsummary
>> > id="ValidationSummary1" style="Z-INDEX: 114; LEFT: 440px; POSITION:
>> > absolute;
>> > TOP: 288px"
>> > Width="364px" runat="server" HeaderText="Please correct the
>> > followings:"></asp:validationsummary><asp:label id="lblSuccess"
>> > style="Z-INDEX: 115; LEFT: 544px; POSITION: absolute; TOP: 240px"
>> > runat="server"></asp:label></DIV>
>> >
>> > Thanks. -Dale
>> >
>>
>>
>>


Nov 17 '05 #10
Hi Ignacio,

i do have problem - can not focus in web control page. the cause is web
control page does not have <body> <form1>.

if you open VS and add a web control, you will not see <body> in the html
version of the page.

thanks. -dale

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi Dale,

I'm completely lost now, do you have problems or not?

The page will have only one <body >

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"dale zhang" <da*******@discussions.microsoft.com> wrote in message
news:79**********************************@microsof t.com...
Hi,

Sorry, web control page does have <body>, <form1> ...

It is different from other web forms.

that is why i have troubles.

thanks anyway. -dale

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,

It does compile indeed, as a matter of fact, the only line you have to
include in the code behind (the one which gets compiled) is the
Controls.Add

<body> is the tag that start the page, all aspx pages have one, why are
you
including it inside a DIV ?
There is only one <body> in your page, just add the onload event to the
one
you have.

also the script part can be placed at any place, it's just customary to
place it in the header.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"dale zhang" <da*******@discussions.microsoft.com> wrote in message
news:0D**********************************@microsof t.com...
> Hi,
>
> Thank you for your help. I guess the clientID is txtUserName.
>
> But the element 'body' can not be nested within 'DIV'.
>
> So this does not compile.
>
> Any idea? -Dale
>
> "Ignacio Machin ( .NET/ C# MVP )" wrote:
>
>> Hi,
>>
>> Your code is not well formatted and very difficult to read,
>> It's very easy, you have to get the clientID of the control to gets
>> the
>> focus, include a javascript code with it and on the onLoad event fire
>> it.
>>
>> In the aspx page:
>>
>> <script>
>> var controlToFocus ='';
>> function OnLoadHandler()
>> {
>> if ( controlToFocus != "" )
>> document.all[controlToFocus].focus();
>> }
>> </script>
>>
>> <body onload="OnLoadHandler();">
>>
>>
>> In the code behind:
>>
>> this.Controls.Add( LiteralControl( "<script>controlToFocus ='" +
>> theControl.ClientID + " ';</script>" );
>>
>>
>> Cheers,
>>
>> --
>> Ignacio Machin,
>> ignacio.machin AT dot.state.fl.us
>> Florida Department Of Transportation
>>
>>
>>
>>
>> "dale zhang" <da*******@discussions.microsoft.com> wrote in message
>> news:CB**********************************@microsof t.com...
>> > Hi,
>> >
>> > I saw the post here about setfocus. But they are for web form.
>> >
>> > Web control page HTML does not have form1. the Jscript there does
>> > not
>> > work
>> > here.
>> >
>> > My question is how to set focus to the text box in web control page?
>> >
>> >
>> > The following is the html version of the page design:
>> >
>> > <DIV style="WIDTH: 992px; POSITION: relative; HEIGHT: 424px"
>> > ms_positioning="GridLayout"><asp:label id="Label3" style="Z-INDEX:
>> > 103;
>> > LEFT:
>> > 344px; POSITION: absolute; TOP: 88px" ForeColor="#FF8080"
>> > runat="server">Please login to access private content</asp:label>
>> >
>> > <asp:textbox id="txtUserName" style="Z-INDEX: 104; LEFT: 448px;
>> > POSITION:
>> > absolute; TOP: 144px"
>> > runat="server"></asp:textbox><asp:label id="lblUserName"
>> > style="Z-INDEX:
>> > 105; LEFT: 280px; POSITION: absolute; TOP: 144px"
>> > runat="server">Enter email address</asp:label><asp:label
>> > id="lblPassword"
>> > style="Z-INDEX: 106; LEFT: 280px; POSITION: absolute; TOP: 192px"
>> > runat="server">Enter password</asp:label><asp:textbox
>> > id="txtPassword"
>> > style="Z-INDEX: 107; LEFT: 448px; POSITION: absolute; TOP: 192px"
>> > runat="server" TextMode="Password"></asp:textbox><asp:button
>> > id="Button1"
>> > style="Z-INDEX: 108; LEFT: 448px; POSITION: absolute; TOP: 240px"
>> > runat="server"
>> > Text="Login"></asp:button>
>> > <asp:regularexpressionvalidator id="revUsername" style="Z-INDEX:
>> > 111;
>> > LEFT:
>> > 664px; POSITION: absolute; TOP: 144px"
>> > runat="server" Display="Dynamic"
>> > ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
>> > ControlToValidate="txtUserName"
>> > ErrorMessage="Enter the email address as :
>> > us**@domain.com">*</asp:regularexpressionvalidator><asp:requiredfieldv alidator
>> > id="rfvUsername" style="Z-INDEX: 112; LEFT: 728px; POSITION:
>> > absolute;
>> > TOP:
>> > 144px"
>> > runat="server" Display="Dynamic" ControlToValidate="txtUserName"
>> > ErrorMessage="Enter the correct user
>> > ID"></asp:requiredfieldvalidator><asp:requiredfieldvalid ator
>> > id="rfvPassword"
>> > style="Z-INDEX: 113; LEFT: 728px; POSITION: absolute; TOP: 192px"
>> > runat="server" Display="Dynamic" ControlToValidate="txtPassword"
>> > ErrorMessage="Enter the correct
>> > password"></asp:requiredfieldvalidator><asp:validationsummary
>> > id="ValidationSummary1" style="Z-INDEX: 114; LEFT: 440px; POSITION:
>> > absolute;
>> > TOP: 288px"
>> > Width="364px" runat="server" HeaderText="Please correct the
>> > followings:"></asp:validationsummary><asp:label id="lblSuccess"
>> > style="Z-INDEX: 115; LEFT: 544px; POSITION: absolute; TOP: 240px"
>> > runat="server"></asp:label></DIV>
>> >
>> > Thanks. -Dale
>> >
>>
>>
>>


Nov 17 '05 #11

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

Similar topics

1
by: jamess | last post by:
Please can someone tell me why, when redirecting from a page with a large dataset, the action takes much longer than with a small set? Also, how can I setfocus to a control; (the default being...
6
by: KS | last post by:
I have made a WebForm with log ON/OFF off users. There is a label that shows the total count off users logged on stored in Application("UserCount") It works fine if the users logs out WITH THE...
4
by: Mad Scientist Jr | last post by:
i am trying to set focus to a specific control depending on the outcome of a validator control and it is not working. none of these methods are working to setfocus: 1....
0
by: MrsLeigh | last post by:
I have a datagrid on a web page. In the footer there is a field that should be recieve the focus, either at the start or after a button is clicked to insert the row that is being added in the...
1
by: fonzie | last post by:
I a form with tab control will all fields based on one table. I have some code setup for the 'On Change' event of the tab control that checks to see if a field on the main form is null. If it is,...
2
by: gnewsham | last post by:
I am converting an application from vb.net 2003 to 2005 I have the following function which I call when an input error is detected: Private Sub SetFocus(ByVal ctrl As System.Web.UI.Control) Dim...
5
agroover
by: agroover | last post by:
I can't seem to figure out how to get rid of the errors. I recieve the following error when I leave the Grade.SetFocus in my code... Microsoft Access can't move the focus to the control Grade ...
0
by: trint | last post by:
I have several GridViews that call a fuction, when clicked, called "getSelected". The very last thing I want getSelected to do is to SetFocus on a FormView (FormView1). Here is how I have this...
4
by: trint | last post by:
I have SetFocus(GridView1) set to the gridview. However, it just goes to the left edge of the control instead of making it visible in the center of the aspx page. Any help is appreciated....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.