RadTextBox TextMode Password and EmptyMessage

4 posts, 0 answers
  1. Fabio Cirillo
    Fabio Cirillo avatar
    180 posts
    Member since:
    Jan 2010

    Posted 19 Nov 2012 Link to this post

    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
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 19 Nov 2012 Link to this post

    Hi,

    Check the following forum thread which discussed similar scenario.
    RadTextBox, TextMode=Password and EmptyText

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Fabio Cirillo
    Fabio Cirillo avatar
    180 posts
    Member since:
    Jan 2010

    Posted 20 Nov 2012 Link to this post

    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:

    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?

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

  5. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 23 Nov 2012 Link to this post

    Hello Fabio,

    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.
Back to Top