Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases 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 December 16th, 2010, 05:30 PM
Authorized User
 
Join Date: Dec 2009
Posts: 85
Thanks: 16
Thanked 0 Times in 0 Posts
Default triggering a db function using jquery/get

Hi Imar

thanks for that - I've been debugging my update page which the code should call and that's now working correctly - there were a couple of errors.

However, I'm still not getting it to call the update page from the onClick function - when you say put the debugger before the line with the get call how would you do that - i.e what code would you use for the debugger?

thanks

Adam
 
Old December 16th, 2010, 05:48 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Not *the debugger*, but just the word debugger. E.g.:
Code:
 <script type="text/javascript">
    function Update(id) {
      debugger
      $.get("Test.aspx", { id: id });
    }
  </script>
This triggers *the* debugger so you can look at the id variable and see if Update gets called at all. As an alternative to debugger, you can also add a simple alert('Called'); statement there. Also, you may want to look at Fiddler (http://www.fiddler2.com/fiddler2/) to see if the update page gets called at all.

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!
 
Old December 16th, 2010, 05:55 PM
Authorized User
 
Join Date: Dec 2009
Posts: 85
Thanks: 16
Thanked 0 Times in 0 Posts
Default triggering a db function using jquery/get

I think you've cracked it!!!

Not sure why but when I put this in like this:

<script type="text/javascript">
function Update(id) {
debugger
$.get("customer_update.asp", { id: id });
}
</script>


it works?!?

Anyway I think/hope I can take it from here now you've done all the hard work - thanks so much Imar.

Most grateful.

all the best

Adam
 
Old December 16th, 2010, 06:01 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You mean the update page is now called? That's odd; debugger should just trigger the debugger, and not change any behavior....

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!
 
Old December 16th, 2010, 06:04 PM
Authorized User
 
Join Date: Dec 2009
Posts: 85
Thanks: 16
Thanked 0 Times in 0 Posts
Default triggering a db function using jquery/get

Indeed, it is very odd - anyway I'm going to leave it for now and tackle it again in the morning - thanks very much.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Triggering - cancer10 Classic ASP Databases 1 May 5th, 2007 05:15 AM
CustomValidation not triggering jacob ASP.NET 1.x and 2.0 Application Design 2 December 1st, 2005 04:31 PM
Triggering a javascript function badgolfer ASP.NET 1.0 and 1.1 Basics 1 June 30th, 2004 06:31 AM
Returning a result from a db function not allowed? treycarroll Beginning PHP 2 March 17th, 2004 07:53 PM
Validation is not triggering bmains ASP.NET 1.0 and 1.1 Professional 2 February 11th, 2004 02:23 PM





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