Verify using AJAX on page load

Posted on 2014-03-25
Last Modified: 2014-03-31
Hi all,

I have a verify.aspx page.

I would like to load the page initially, then use ajax and a web method to run a some db function.

Does anyone have any ideas how I would load the page initally and then trigger the ajax call once the page has loaded?
Question by:flynny
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 82

Accepted Solution

leakim971 earned 500 total points
ID: 39954640
Using PageMethod it's easy :

public static string RunDBFunction()

Open in new window

window.onload = function() {
      PageMethods.RunDBFunction(onSucceed, onError);
function onSucceed(result) {
function onError(result) {      

Open in new window


Expert Comment

ID: 39965108
I would go for master page instead and make a call to the webservice from jquery on master page.

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : All lightning effects with instructions : http://www.mediaf…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question