
Fabio Cirillo
Top achievements
Rank 1
Fabio Cirillo
asked on 19 Nov 2012, 11:05 AM
Hello,
I would like to set the emptymessage on a radtexbox the property TextMode = Password, but when I start the web page Radtextbox is empty you can not see the emptymessage, why? And how can I do?
Bye
I would like to set the emptymessage on a radtexbox the property TextMode = Password, but when I start the web page Radtextbox is empty you can not see the emptymessage, why? And how can I do?
Bye
3 Answers, 1 is accepted
0

Princy
Top achievements
Rank 2
answered on 19 Nov 2012, 11:39 AM
Hi,
Check the following forum thread which discussed similar scenario.
RadTextBox, TextMode=Password and EmptyText
Thanks,
Princy.
Check the following forum thread which discussed similar scenario.
RadTextBox, TextMode=Password and EmptyText
Thanks,
Princy.
0

Fabio Cirillo
Top achievements
Rank 1
answered on 20 Nov 2012, 03:53 PM
ok I chose this code: Set EmptyMessage for TextBox in Password Mode
but now I can not pass the value of radtextbox in vb net. My code is:
but txt_password always is null
code html is:
but now I can not pass the value of radtextbox in vb net. My code is:
sqlcmd.Parameters.AddWithValue(
"@password", SqlDbType.VarChar).Value = Txt_Password1.Text
but txt_password always is null
code html is:
<
telerik:RadScriptBlock
ID
=
"RadScriptBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function OnFocus1(sender, eventArgs) {
$get('PasswordMask1').style.display = 'none';
$get('Password1').style.display = 'inline';
$find('<%= Txt_password1.ClientID %>').focus();
}
function OnBlur1(sender, eventArgs) {
if (sender.isEmpty()) {
$get('PasswordMask1').style.display = 'inline';
$get('Password1').style.display = 'none';
}
}
</
script
>
</
telerik:RadScriptBlock
>
<
div
id
=
"PasswordMask1"
style
=
"width: 270px;"
>
<
telerik:RadTextBox
ID
=
"Txt_passwordhide1"
runat
=
"server"
EmptyMessage
=
"Password"
ClientEvents-OnFocus
=
"OnFocus1"
Width
=
"270px"
MaxLength
=
"20"
/>
</
div
>
<
div
id
=
"Password1"
style
=
"display:none; width: 270px;"
>
<
telerik:RadTextBox
ID
=
"Txt_Password1"
runat
=
"server"
TextMode
=
"Password"
ClientEvents-OnBlur
=
"OnBlur1"
MaxLength
=
"20"
Width
=
"270px"
/>
</
div
>
why?
0
Hello Fabio,
I tested this and it works:
C#:
All the best,
Vasil
the Telerik team
I tested this and it works:
<
telerik:RadScriptBlock
ID
=
"RadScriptBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function OnFocus(sender, eventArgs)
{
$get('PasswordMask').style.display = 'none';
$get('Password').style.display = 'inline';
$find('<%= RadTextBox3.ClientID %>').focus();
}
function OnBlur(sender, eventArgs)
{
if (sender.isEmpty())
{
$get('PasswordMask').style.display = 'inline';
$get('Password').style.display = 'none';
}
}
</
script
>
</
telerik:RadScriptBlock
>
<
div
id
=
"PasswordMask"
>
<
telerik:RadTextBox
ID
=
"RadTextBox2"
runat
=
"server"
EmptyMessage
=
"Password"
ClientEvents-OnFocus
=
"OnFocus"
/>
</
div
>
<
div
id
=
"Password"
style
=
"display: none;"
>
<
telerik:RadTextBox
ID
=
"RadTextBox3"
runat
=
"server"
TextMode
=
"Password"
ClientEvents-OnBlur
=
"OnBlur"
/>
</
div
>
<
br
/>
<
asp:Label
runat
=
"server"
ID
=
"label1"
></
asp:Label
>
<
asp:Button
runat
=
"server"
Text
=
"click"
/>
C#:
public
void
Page_Load(
object
sender, EventArgs e)
{
label1.Text = RadTextBox3.Text;
}
All the best,
Vasil
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.