[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

pramod

2/9/2004 3:27:00 PM

Hi,

I want to know if this is possible.

Can TextBox webcontrol be set in a way all the charaters entered by user are
uppercase.

Is this possible? if yes how?

thanks in advance.
-P


6 Answers

jamesche

2/9/2004 4:11:00 PM

0

Hi Pramod,

You can do this in many ways. If you want to depend on the user to do this
and just notify them when they haven't, the RegularExpressionValidator
control is a perfect solution. If you want to allow the user to enter
lower-case characters and then convert them to upper-case yourself, that's
easy as well.

Depending on the language you are using and whether you need the text
upper-case when it's on the client or on the server, the options will be
different. Can you be more specific? If you can also tell us what
language you're using, we can provide possible samples in the language you
are used to.

Jim Cheshire, MCSE, MCSD [MSFT]
ASP.NET
Developer Support
jamesche@online.microsoft.com

This post is provided as-is with no warranties and confers no rights.


--------------------
>From: "pramod" <pramodrane@hotmail.com>
>Subject: TextBox WebControl
>Date: Mon, 9 Feb 2004 10:26:49 -0500
>Lines: 13
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
>Message-ID: <eCeXkEy7DHA.712@tk2msftngp13.phx.gbl>
>Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
>NNTP-Posting-Host: out3.datatelecomm.net 167.23.240.20
>Path:
cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.
phx.gbl
>Xref: cpmsftngxa07.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:18152
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
>
>Hi,
>
>I want to know if this is possible.
>
>Can TextBox webcontrol be set in a way all the charaters entered by user
are
>uppercase.
>
>Is this possible? if yes how?
>
>thanks in advance.
>-P
>
>
>

pramod

2/9/2004 4:36:00 PM

0

Jim Thanks for your response.

But this is what I am looking for.

When user start typing in TextBox control, irrespective to caps lock on or
off character typed should be uppercase.

As of now I let user type in any case and then convert them to uppercase.

I am using C# language.

thanks,
-P

"Jim Cheshire [MSFT]" <jamesche@online.microsoft.com> wrote in message
news:2f7JFdy7DHA.1988@cpmsftngxa07.phx.gbl...
> Hi Pramod,
>
> You can do this in many ways. If you want to depend on the user to do
this
> and just notify them when they haven't, the RegularExpressionValidator
> control is a perfect solution. If you want to allow the user to enter
> lower-case characters and then convert them to upper-case yourself, that's
> easy as well.
>
> Depending on the language you are using and whether you need the text
> upper-case when it's on the client or on the server, the options will be
> different. Can you be more specific? If you can also tell us what
> language you're using, we can provide possible samples in the language you
> are used to.
>
> Jim Cheshire, MCSE, MCSD [MSFT]
> ASP.NET
> Developer Support
> jamesche@online.microsoft.com
>
> This post is provided as-is with no warranties and confers no rights.
>
>
> --------------------
> >From: "pramod" <pramodrane@hotmail.com>
> >Subject: TextBox WebControl
> >Date: Mon, 9 Feb 2004 10:26:49 -0500
> >Lines: 13
> >X-Priority: 3
> >X-MSMail-Priority: Normal
> >X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
> >Message-ID: <eCeXkEy7DHA.712@tk2msftngp13.phx.gbl>
> >Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
> >NNTP-Posting-Host: out3.datatelecomm.net 167.23.240.20
> >Path:
>
cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.
> phx.gbl
> >Xref: cpmsftngxa07.phx.gbl
> microsoft.public.dotnet.framework.aspnet.webcontrols:18152
> >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
> >
> >Hi,
> >
> >I want to know if this is possible.
> >
> >Can TextBox webcontrol be set in a way all the charaters entered by user
> are
> >uppercase.
> >
> >Is this possible? if yes how?
> >
> >thanks in advance.
> >-P
> >
> >
> >
>


Rafael Veronezi

2/9/2004 4:56:00 PM

0

You can write a CSS class and assign it to the TextBox
It will look like something like that

<style> .uppertext { text-transform: uppercase; } </style><asp:TextBox ID="myTextBox" CssClass="uppertext" Runat="Server" /

This way, it preserves what the user types when you parse it back to the server..
So, if you need to use store this upper-case, you still need to upper it in your code

string Result
Result = myTextBox.ToUpper()

Still, you load some value into the textbox, it automatically Uppercase it..
This property of stylesheet still provides a Capitalization option, it's interesting because you don't need to implement any aditional client script/code.

jamesche

2/9/2004 4:58:00 PM

0

Pramod,

In that case, you will need to use client-side script. This is not going
to be possible with ASP.NET because HTTP is a disconnected architecture.

Here is a simple sample of JavaScript that will do what you want to do:

<input id="myInputBox" type="text" onkeyup="this.value =
this.value.toUpperCase();">

Jim Cheshire, MCSE, MCSD [MSFT]
ASP.NET
Developer Support
jamesche@online.microsoft.com

This post is provided as-is with no warranties and confers no rights.

--------------------
>From: "pramod" <pramodrane_remove_this_nospam_@hotmail.com>
>References: <eCeXkEy7DHA.712@tk2msftngp13.phx.gbl>
<2f7JFdy7DHA.1988@cpmsftngxa07.phx.gbl>
>Subject: Re: TextBox WebControl
>Date: Mon, 9 Feb 2004 11:35:37 -0500
>Lines: 77
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
>Message-ID: <#Nt2Ary7DHA.2308@TK2MSFTNGP11.phx.gbl>
>Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
>NNTP-Posting-Host: out3.datatelecomm.net 167.23.240.20
>Path:
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08
.phx.gbl!TK2MSFTNGP11.phx.gbl
>Xref: cpmsftngxa07.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:18160
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
>
>Jim Thanks for your response.
>
>But this is what I am looking for.
>
>When user start typing in TextBox control, irrespective to caps lock on or
>off character typed should be uppercase.
>
>As of now I let user type in any case and then convert them to uppercase.
>
>I am using C# language.
>
>thanks,
>-P
>
>"Jim Cheshire [MSFT]" <jamesche@online.microsoft.com> wrote in message
>news:2f7JFdy7DHA.1988@cpmsftngxa07.phx.gbl...
>> Hi Pramod,
>>
>> You can do this in many ways. If you want to depend on the user to do
>this
>> and just notify them when they haven't, the RegularExpressionValidator
>> control is a perfect solution. If you want to allow the user to enter
>> lower-case characters and then convert them to upper-case yourself,
that's
>> easy as well.
>>
>> Depending on the language you are using and whether you need the text
>> upper-case when it's on the client or on the server, the options will be
>> different. Can you be more specific? If you can also tell us what
>> language you're using, we can provide possible samples in the language
you
>> are used to.
>>
>> Jim Cheshire, MCSE, MCSD [MSFT]
>> ASP.NET
>> Developer Support
>> jamesche@online.microsoft.com
>>
>> This post is provided as-is with no warranties and confers no rights.
>>
>>
>> --------------------
>> >From: "pramod" <pramodrane@hotmail.com>
>> >Subject: TextBox WebControl
>> >Date: Mon, 9 Feb 2004 10:26:49 -0500
>> >Lines: 13
>> >X-Priority: 3
>> >X-MSMail-Priority: Normal
>> >X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
>> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
>> >Message-ID: <eCeXkEy7DHA.712@tk2msftngp13.phx.gbl>
>> >Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
>> >NNTP-Posting-Host: out3.datatelecomm.net 167.23.240.20
>> >Path:
>>
>cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13

pramod

2/9/2004 6:03:00 PM

0

Thanks Jim..

"Jim Cheshire [MSFT]" <jamesche@online.microsoft.com> wrote in message
news:vzQRw3y7DHA.568@cpmsftngxa07.phx.gbl...
> Pramod,
>
> In that case, you will need to use client-side script. This is not going
> to be possible with ASP.NET because HTTP is a disconnected architecture.
>
> Here is a simple sample of JavaScript that will do what you want to do:
>
> <input id="myInputBox" type="text" onkeyup="this.value =
> this.value.toUpperCase();">
>
> Jim Cheshire, MCSE, MCSD [MSFT]
> ASP.NET
> Developer Support
> jamesche@online.microsoft.com
>
> This post is provided as-is with no warranties and confers no rights.
>
> --------------------
> >From: "pramod" <pramodrane_remove_this_nospam_@hotmail.com>
> >References: <eCeXkEy7DHA.712@tk2msftngp13.phx.gbl>
> <2f7JFdy7DHA.1988@cpmsftngxa07.phx.gbl>
> >Subject: Re: TextBox WebControl
> >Date: Mon, 9 Feb 2004 11:35:37 -0500
> >Lines: 77
> >X-Priority: 3
> >X-MSMail-Priority: Normal
> >X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
> >Message-ID: <#Nt2Ary7DHA.2308@TK2MSFTNGP11.phx.gbl>
> >Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
> >NNTP-Posting-Host: out3.datatelecomm.net 167.23.240.20
> >Path:
>
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08
> phx.gbl!TK2MSFTNGP11.phx.gbl
> >Xref: cpmsftngxa07.phx.gbl
> microsoft.public.dotnet.framework.aspnet.webcontrols:18160
> >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
> >
> >Jim Thanks for your response.
> >
> >But this is what I am looking for.
> >
> >When user start typing in TextBox control, irrespective to caps lock on
or
> >off character typed should be uppercase.
> >
> >As of now I let user type in any case and then convert them to uppercase.
> >
> >I am using C# language.
> >
> >thanks,
> >-P
> >
> >"Jim Cheshire [MSFT]" <jamesche@online.microsoft.com> wrote in message
> >news:2f7JFdy7DHA.1988@cpmsftngxa07.phx.gbl...
> >> Hi Pramod,
> >>
> >> You can do this in many ways. If you want to depend on the user to do
> >this
> >> and just notify them when they haven't, the RegularExpressionValidator
> >> control is a perfect solution. If you want to allow the user to enter
> >> lower-case characters and then convert them to upper-case yourself,
> that's
> >> easy as well.
> >>
> >> Depending on the language you are using and whether you need the text
> >> upper-case when it's on the client or on the server, the options will
be
> >> different. Can you be more specific? If you can also tell us what
> >> language you're using, we can provide possible samples in the language
> you
> >> are used to.
> >>
> >> Jim Cheshire, MCSE, MCSD [MSFT]
> >> ASP.NET
> >> Developer Support
> >> jamesche@online.microsoft.com
> >>
> >> This post is provided as-is with no warranties and confers no rights.
> >>
> >>
> >> --------------------
> >> >From: "pramod" <pramodrane@hotmail.com>
> >> >Subject: TextBox WebControl
> >> >Date: Mon, 9 Feb 2004 10:26:49 -0500
> >> >Lines: 13
> >> >X-Priority: 3
> >> >X-MSMail-Priority: Normal
> >> >X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
> >> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
> >> >Message-ID: <eCeXkEy7DHA.712@tk2msftngp13.phx.gbl>
> >> >Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
> >> >NNTP-Posting-Host: out3.datatelecomm.net 167.23.240.20
> >> >Path:
> >>
>
>cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13


pramod

2/9/2004 6:04:00 PM

0

Thanks Rafa
"Rafa®" <lixorafa@terra.com.br> wrote in message
news:3F6E1341-AF32-4039-A193-97D45611472A@microsoft.com...
> You can write a CSS class and assign it to the TextBox.
> It will look like something like that:
>
> <style> .uppertext { text-transform: uppercase; } </style><asp:TextBox
ID="myTextBox" CssClass="uppertext" Runat="Server" />
>
> This way, it preserves what the user types when you parse it back to the
server...
> So, if you need to use store this upper-case, you still need to upper it
in your code:
>
> string Result;
> Result = myTextBox.ToUpper();
>
> Still, you load some value into the textbox, it automatically Uppercase
it...
> This property of stylesheet still provides a Capitalization option, it's
interesting because you don't need to implement any aditional client
script/code.