Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 19th, 2013, 05:46 AM
Registered User
 
Join Date: Oct 2011
Posts: 5
Thanks: 3
Thanked 1 Time in 1 Post
Default SCRIPT5007: Unable to get value of the property 'attachAll': object is null or undefi

Hi Imar,

I am trying to do "TRY IT OUT" on p397-399 on your book of BEGINNING
ASP.NET 4:IN C# AND VB. I could not understand why I get this error message
-- $.updnWatermark undefined.

At the bottom, I called the function - $.updnWatermark.attachAll({ cssClass: 'Watermark' });

Thanks.

Han


<%@ Control Language="VB" AutoEventWireup="false" CodeFile="ContactForm.ascx.vb" Inherits="Controls_ContactForm" %>
<%If False Then%>
<script src="../Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
<%End If%>
<style type="text/css">
.style1
{
width: 100%;
}
</style>
<script type="text/javascript">
function ValidatePhoneNumbers(source, args) {
var phoneHome = document.getElementById('<%= PhoneHome.ClientID %>');
var phoneBusiness = document.getElementById('<%= PhoneBusiness.ClientID %>');
if (phoneHome.value != '' || phoneBusiness.value != '') {
args.IsValid = true;
}
else {
args.IsValid = false;
}
}
</script>
<asp:UpdatePanel runat="server" ID="UpdatePanel1">
<ContentTemplate>
<div id="TableWrapper">
<table class="style1" runat="server" id="FormTable">
<tr>
<td colspan="3">
<h1>Get in touch with us</h1>
<p>Use the form below to get in touch with us. Enter your name, e-mail address, and your home or business phone number to get in touch with us.</p>
</td>
</tr>
<tr>
<td>
Name
</td>
<td>
<asp:TextBox ID="Name" runat="server" CssClass="InputBox" ToolTip="Enter your name"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="Name" CssClass="ErrorMessage" ErrorMessage="Enter your name">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
E-mail address
</td>
<td>
<asp:TextBox ID="EmailAddress" runat="server" CssClass="InputBox" ToolTip="Enter your e-mail address"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="EmailAddress" CssClass="ErrorMessage" Display="Dynamic" ErrorMessage="Enter an e-mail address">*</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="EmailAddress" CssClass="ErrorMessage" Display="Dynamic" ErrorMessage="Enter a valid e-mail address" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">*</asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td>
E-mail address again
</td>
<td>
<asp:TextBox ID="ConfirmEmailAddress" runat="server" CssClass="InputBox" ToolTip="Confirm your e-mail address"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="ConfirmEmailAddress" CssClass="ErrorMessage" Display="Dynamic" ErrorMessage="Confirm the e-mail address">*</asp:RequiredFieldValidator>
<asp:CompareValidator ID="CompareValidator1" runat="server" ControlToCompare="EmailAddress" ControlToValidate="ConfirmEmailAddress" CssClass="ErrorMessage" Display="Dynamic" ErrorMessage="Retype the e-mail address">*</asp:CompareValidator>
</td>
</tr>
<tr>
<td>
Home phone number
</td>
<td>
<asp:TextBox ID="PhoneHome" runat="server" CssClass="InputBox" ToolTip="Enter your home phone number"></asp:TextBox>
</td>
<td>
<asp:CustomValidator ID="CustomValidator1" runat="server" ClientValidationFunction="ValidatePhoneNumbers" CssClass="ErrorMessage" Display="Dynamic" ErrorMessage="Enter your home or business phone number">*</asp:CustomValidator>
</td>
</tr>
<tr>
<td>
Business phone number
</td>
<td>
<asp:TextBox ID="PhoneBusiness" runat="server" CssClass="InputBox" ToolTip="Enter your business phone number"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
Comments
</td>
<td>
<asp:TextBox ID="Comments" runat="server" Height="78px" TextMode="MultiLine" CssClass="InputBox" ToolTip="Enter your comments"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="Comments" CssClass="ErrorMessage" Display="Dynamic" ErrorMessage="Enter a comment">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:Button ID="SendButton" runat="server" Text="Send" />
</td>
<td>
</td>
</tr>
<tr>
<td colspan="3">
<asp:ValidationSummary ID="ValidationSummary1" runat="server"
CssClass="ErrorMessage"
HeaderText="Please correct the following errors before you press the Send button:"
ShowMessageBox="True" ShowSummary="False" />
</td>
</tr>
</table>
</div>
<asp:Label ID="Message" runat="server" Text="Message Sent" CssClass="Attention" Visible="False" />
<p runat="server" id="MessageSentPara" visible="False">Thank you for your message. We'll get in touch with you if necessary.</p>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
<ProgressTemplate>
<div class="PleaseWait">Please Wait... </div>
</ProgressTemplate>
</asp:UpdateProgress>
<script src="../Scripts/jquery.updnWatermark.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$.updnWatermark.attachAll({ cssClass: 'Watermark' });
$('form').bind('submit', function () {
if (Page_IsValid) {
$('#TableWrapper').slideUp(3000);
}
});
});
function pageLoad() {
$('.Attention').animate({ width: '600px' }, 3000).animate({ width: '100px' }, 3000).fadeOut('slow');
}
</script>

Last edited by SunsetFlorida; March 19th, 2013 at 07:29 AM..
 
Old March 19th, 2013, 10:41 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

As suggested in my personal e-mail, make sure the reference to the watermark library is correct. From which page (the full address) are you calling this code?

Have you tried replace ../ with just a / ?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
SunsetFlorida (March 19th, 2013)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to find Virtual Path property in VS2012 joshpw BOOK: Beginning ASP.NET 4.5 : in C# and VB 2 February 25th, 2013 03:45 AM
Unable so assign value to .Lookin Property Colster Excel VBA 1 August 24th, 2007 03:16 PM
"Unable to set the FormulaArray property..." rduncan1 Excel VBA 2 August 18th, 2006 01:33 PM
Unable to set image or cursor property, Ch 12. VictorVictor BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 5 April 26th, 2006 10:49 AM
null or not a object crmpicco Javascript How-To 5 March 22nd, 2005 10:48 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.