AJAX Toolkit provides a variety of controls and extenders.
In this blog I would discuss use of Watermarkextender to
In this blog I would discuss use of Watermarkextender to
- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default"%>
- <%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
- <cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"> </cc1:ToolkitScriptManager>
- <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox><br />
- <cc1:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" TargetControlID="TextBox2" WatermarkText="Enter username here" runat="server">
- </cc1:TextBoxWatermarkExtender>
It has two important properties "TargetControlID" and "WatermarkText"
TargetControlID: tells to which control this extender is attached.WatermarkText: tells the text which would be displayed in target control attached with TextBoxWatermarkExtender.
Note1: When you are using ajax toolkit controls always use ToolkitScriptManager instead of ScriptManager.
Note2:If you got the error(Could not load type 'System.Web.UI.ScriptReferenceBase' from assembly 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35').
Use the ScriptManager instead of ToolkitScriptManager .
No comments:
Post a Comment