Error in creating water marking in Ajax

Posted by Seger under ASP.NET on 7/20/2010 | Views : 2082 | Status : [Member] | Replies : 2
Error Creating Control - TextBoxWatermarkExtender1This control cannot be displayed because its TagPrefix is not registered in this Web Form.



coding:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server" />
Name:

<asp:TextBox ID="TextBox1" runat="server" CssClass="nonwatermarked" />

<ajax:TextBoxWatermarkExtender
ID="TextBoxWatermarkExtender1"
runat="server"
Enabled="True"
TargetControlID="TextBox1"
WatermarkCssClass="watermarked"
WatermarkText="Enter Name Here">
</ajax:TextBoxWatermarkExtender>

<br />

Phone:

<asp:TextBox ID="TextBox2" runat="server" CssClass="nonwatermarked" />

<ajax:TextBoxWatermarkExtender
ID="TextBoxWatermarkExtender2"
runat="server"
Enabled="True"
TargetControlID="TextBox2"
WatermarkCssClass="watermarked"
WatermarkText="Enter Phone Here">
</ajax:TextBoxWatermarkExtender>

<br /> <br />

<asp:Button ID="Button1" runat="server" Text="Submit " />
</div>
</form>
</body>
</html>




Responses

Posted by: Vuyiswamb on: 7/20/2010 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Change your markup to this

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server" />
Name:

<asp:TextBox ID="TextBox1" runat="server" CssClass="nonwatermarked" />

<ajax:TextBoxWatermarkExtender
ID="TextBoxWatermarkExtender1"
runat="server"
Enabled="True"
TargetControlID="TextBox1"
WatermarkCssClass="watermarked"
WatermarkText="Enter Name Here">
</ajax:TextBoxWatermarkExtender>

<br />

Phone:

<asp:TextBox ID="TextBox2" runat="server" CssClass="nonwatermarked" />

<ajax:TextBoxWatermarkExtender
ID="TextBoxWatermarkExtender2"
runat="server"
Enabled="True"
TargetControlID="TextBox2"
WatermarkCssClass="watermarked"
WatermarkText="Enter Phone Here">
</ajax:TextBoxWatermarkExtender>

<br /> <br />

<asp:Button ID="Button1" runat="server" Text="Submit " />
</div>
</form>
</body>
</html>


Thank you for posting at Dotnetfunda
[Administrator]

Seger, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Seger on: 7/20/2010 [Member] Starter

Up
0
Down
Server Error in '/WebSite6' Application.
--------------------------------------------------------------------------------

Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load file or assembly 'AjaxToolkit' or one of its dependencies. The system cannot find the file specified.

Source Error:


Line 1: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
Line 2: <%@ Register Assembly="AjaxToolkit" Namespace="AjaxToolkit" TagPrefix="AjaxToolkit" %>
Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Line 4:



Seger, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response