How to add Ajax Watermark Extender in Apsnet
Hi Friends I would like to explain All the Ajax Toolkit Extenders from this I am going to explain the Watermark Extender
Before to use the Watermark Extender why we have to use Watermark Extender, the main purpose is it displays the watermark text on the Textbox control .so user can easily understands what we have to enter in that textbox
Before to use the Watermark Extender why we have to use Watermark Extender, the main purpose is it displays the watermark text on the Textbox control .so user can easily understands what we have to enter in that textbox
so lets start the how to use Watermark Extender. I already explained about how to integrate Ajax Toolkit to our Asp net application. if you have any doubt regarding integration just click here
So open your first ASP net application and open anyone one of your (.apsx) page.
Here you’re going to integrate Watermark Extender.
Here, I would like to add Watermark Extender to my registration page.
First, Open the source page of Registration page and these two lines otherwise your Ajax will not work.
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
Next, open the design page of Registration form and add watermark extender for calendar textbox
So op
Just click on Textbox and click on the Add Extender
Next, select the Validation Callout Extender from the dialogue box and click ok button
Next finally, set the properties of watermark extender
Now code the will be look like this
<asp:TextBox ID="txt_DOB" runat="server" Width="130px"></asp:TextBox>
<cc1:TextBoxWatermarkExtender ID="txt_DOB_TextBoxWatermarkExtender"
runat="server" Enabled="True" TargetControlID="txt_DOB"
WatermarkCssClass="watermarked" WatermarkText="dd/mm/yyyy">
</cc1:TextBoxWatermarkExtender>
<cc1:CalendarExtender ID="txt_DOB_CalendarExtender" runat="server"
Enabled="True" TargetControlID="txt_DOB">
</cc1:CalendarExtender>
And finally the output will be look like this
That’s it Friends……
5 Comments:
Another Goood article for beginners
I want to Change text of watermark programitically.that is
if(something)
{
txtwatermark.watermarktext = "Something";
}
else
{
txtwatermark.watermarktext = "Nothing";
}
i have done it in this way but it's not working.
:(
Hey anand..thanks for sharing.we can also change the water mark text by programmtically..its better to use javascript to change the text.for clear explanation
use this link http://blog.turlov.com/2010/05/how-to-set-programmatically-value-of.html
I hope this will helps you
I want to Change text of watermark programitically.that is
if(something)
{
txtwatermark.watermarktext = "Something";
}
else
{
txtwatermark.watermarktext = "Nothing";
}
i have done it in this way but it's not working.
:(
Another Goood article for beginners
Post a Comment
Subscribe to Post Comments [Atom]
<< Home