Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
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
  #11 (permalink)  
Old February 23rd, 2012, 08:34 PM
Authorized User
Points: 353, Level: 6
Points: 353, Level: 6 Points: 353, Level: 6 Points: 353, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2011
Posts: 86
Thanks: 20
Thanked 3 Times in 3 Posts
Default Another bit of info

If I remove { cssClass: 'Watermark' } from the $.updnWatermark.attachAll({ cssClass: 'Watermark' }); I get the same error in my UC page.

If I do the same thing in your sample, I don't get any error - just does not show the tool tip text in the text box.
  #12 (permalink)  
Old February 23rd, 2012, 08:38 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

HI there,

Looks indeed like the path to the JS file is incorrect. Try adding it as a script reference like the jQuery file. Alternatively, compare your code with the actual path, Something like:

Code:
 
<script src="/Scripts/jquery.updnWatermark.js" type="text/javascript"></script>
should work, provided you set the site's Virtual Path to / as explained earlier in the book, and provided that the JS file exists in the Scripts folder of course.

Cheers,

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!
  #13 (permalink)  
Old February 23rd, 2012, 09:09 PM
Authorized User
Points: 353, Level: 6
Points: 353, Level: 6 Points: 353, Level: 6 Points: 353, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2011
Posts: 86
Thanks: 20
Thanked 3 Times in 3 Posts
Default Still Not Work

I tried your suggestion and almost every other path combination I could think of. The first question is why did your sample work - as a single page - and mine as a UC does not? Did you try my sample?

The script is there because your sample works. Also, could you remind me again where to set the virtual Path?

I even tried putting the jquery.updnWatermark.js in the root and adjusting the path accordingly - same result. I've been at this for hours so really appreciate your help.
  #14 (permalink)  
Old February 23rd, 2012, 11:59 PM
Authorized User
Points: 353, Level: 6
Points: 353, Level: 6 Points: 353, Level: 6 Points: 353, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2011
Posts: 86
Thanks: 20
Thanked 3 Times in 3 Posts
Default Path

Hi Imar,

I recalled how to set the path in the properties for the site. It was "/mysite"
and I changed it to "/". Now the script works in the UC.

I'm still puzzled how this made such a difference versus using the "~/" notation. I thought that the "~" resolved a lot of these issues.

Thanks for giving me the clue!
  #15 (permalink)  
Old February 24th, 2012, 01:37 AM
natsuto
Guest
 
Posts: n/a
Default

The watermark script loaded above link to a file folder, and then to the Scripts folder and a folder from the current page Kodak 10. Yes, does it?
Received Infraction
  #16 (permalink)  
Old February 25th, 2012, 04:50 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
I thought that the "~" resolved a lot of these issues.
Yes, but only for server side resources, as the ~ is resolved at the server. If you have a plain client side HTML element such as a <script> element it won't work.

Cheers,

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!
  #17 (permalink)  
Old February 25th, 2012, 10:49 PM
Authorized User
Points: 353, Level: 6
Points: 353, Level: 6 Points: 353, Level: 6 Points: 353, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2011
Posts: 86
Thanks: 20
Thanked 3 Times in 3 Posts
Default Makes Sense

Hi Imar,

Thanks again, that explanation makes sense.




Similar Threads
Thread Thread Starter Forum Replies Last Post
JQuery Troubles- Chapter 11, Exercise 1 Princess Rose BOOK: Beginning ASP.NET 4 : in C# and VB 6 May 3rd, 2010 05:35 PM
Ch 11 Question tixrus BOOK: Beginning JavaScript and CSS Development with jQuery 0 April 11th, 2010 05:23 PM
Problem Playing Video using listings 11-4 through 11-6 emanuel BOOK: Professional Android 2 Application Development 3 April 7th, 2010 02:16 PM
Ch 11 Pg459 Exercise 5 C# brivad BOOK: Beginning ASP.NET 1.0 0 September 10th, 2007 08:59 AM





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