Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 616091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:17:22+00:00 2026-05-13T18:17:22+00:00

Ive set up a basic client side callback to a WCF service. see sample

  • 0

Ive set up a basic client side callback to a WCF service. see sample code below.

when viewing using an http filter attached to the explorer you can see that:
1. service1.svc/js is working fine and return proper java script to the browser
2. serrvice1.svc works and returns a proper json data.
3. call is fine and using alert instead of updating the div info i get the data.

but then after OK on the alert the page is then reloaded from scratch.

cant understand why? got any idea?

code:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="Simple_ClientNetwork_Calls.WebForm1" %>

<!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></title>

</head>
<body >
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
            <Scripts>
                <asp:ScriptReference Path="~/WebKit.js" />
            </Scripts>
             <Services>
                <asp:ServiceReference  Path="~/Service1.svc" />
            </Services>
        </asp:ScriptManager>
      <script type="text/javascript">
          var BedList = null;
          var status = null;

          //add a window.load handler to init any necessary controls
          Sys.Application.add_load(initializeControls);

          function initializeControls(e) {
              status = $get("status");
          }

          function testme() {
              document.bgColor = "#FF0000";
              getBedList();
          }

          function getBedList() {
              iMDsoft.Demo.SimpleService.GetBedList(GetBedListOnSuccess, GetBedListOnFailed);
          }


          function GetBedListOnSuccess(results, context, methodName) {

              var BedList = results
              status.innerText = "Complete" + BedList[0].Name;
          }

          function GetBedListOnFailed(results, context, methodName) {
              status.innerText = "GetBedListOnFailed: " + results.get_message();
          }

    </script>
    <button id="button1" onclick="testme();" >TestMe</button>
    <div id="status">
            </div>
     </div>
    </form>
</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T18:17:23+00:00Added an answer on May 13, 2026 at 6:17 pm

    Not sure if this applies to buttons as well, but at least for links, you need to return false in the onclick event. Try this:

    <button id="button1" onclick="testme();return false;" >TestMe</button>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a basic HTTP client set up in C++, which works ok so
How can I manually set a position with some code? Ok Ive got some
I’ve set up a private NuGet Gallery from github.com/NuGet/NuGetGallery using instructions from here: http://dotnet.dzone.com/news/how-set-local-nuget-gallery
I've got a WCF service that is working for basic queries. I started with
I've read this QA jqGrid filtering on the client-side using "filterToolbar" and this one
Ive got a WCF service that returns content-type 'application/x-gzip' which essentially appears to be
I've set up a basic script which loads a random quote into a web
I've got a basic forum set up. I want the posts#index action to only
Ive set my fonts specifically as follows * {font-size: 1em;} html {font-size: 125%;} body{font-size:
I've set up a test so I can begin using jQuery in a cakePHP

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.