locked
Ajax watermark text from database RRS feed

  • Question

  • User-2048807931 posted

    Hi Friends,

                   I want to display the ajax Watermark text from database. I am trying like this "wmtxtGOAssess_1.WatermarkText = dt.Rows[0]["LowBPForNu"].ToString();" But in the design it needs the watermark text(Error).if any body know pls Share

    Thanks

    Ranjith

    Friday, October 18, 2013 6:59 AM

Answers

  • User-417640953 posted

    Hi krranjithcse,

    I'm glad to you post the issue to asp.net forum.

    From your description, I understand that you want set the WatermarkText value of TextBoxWatermarkExtender in the code behind.

    In the design page, we must add the property WatermarkText first. We can also change it in the code behind.

     <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager>
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            <asp:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" runat="server" TargetControlID="TextBox1"
                WatermarkText=""
                WatermarkCssClass="watermarked" >
    </asp:TextBoxWatermarkExtender>
    
    Code behind:
    
     protected void Page_Load(object sender, EventArgs e)
            {
                this.TextBoxWatermarkExtender1.WatermarkText = "Come from database";
            }

    How to use the TextBoxWatermarkExtender control, please refer below link.

    http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/TextBoxWatermark/TextBoxWatermark.aspx

    If I misunderstand your issue, please let me know. Thanks.


    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, October 21, 2013 2:29 AM
  • User2090756951 posted

    The typical purpose of a watermark is to provide more information to the user about the TextBox itself without cluttering up the rest of the page.

    <ajaxToolkit:TextBoxWatermarkExtender ID="TBWE2" runat="server"
        TargetControlID="TextBox1"
        WatermarkText="Type First Name Here"
        WatermarkCssClass="watermarked" />

    http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/TextBoxWatermark/TextBoxWatermark.aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, October 23, 2013 11:09 PM

All replies