0

In my application I am able to use pagemethods to call server side functions from the client side. This works no problem. Where I am confused is with the return from the server side function. I am returning a string to the client side (html text) which should be ran and shown when executed.

In the past, we used to use RS.Execute to call these functions and after the call, the returned html would show up on the page. Since we have switched to pagemethods so that the application works in multiple browsers, how can get the returned html to populate in the page in the success function? Thank you for your help.

code example

here is the pagemethod call inside one of my java script functions

PageMethods.LoadChild(lnEntityID, lnEntityCat, GLOBALEQUIPID, FullExpand, 0,0, onSuccess, onFail);

this works, as I am able to trace the server side function and see the function being hit - you shouldn't need more of a code example besides that LoadChild returns a string - which is actually html text. My issue is what needs to be placed in the onSuccess Javascript function so that the returned text from LoadChild can be placed on the page so that the new div and table row (which are what the html returned text represents) show up instantly on the page with our reloading.

2
  • please post a code sample so we can see what you're doing Commented Apr 26, 2012 at 18:24
  • more information has been added. i can assure you that my pagemethod call works since i am able to use tracepoints to see it is being fully called, its just the string that is returned, needs to be placed on the page as html text so the next row of the table shows up with out refreshing the whole page. Commented Apr 26, 2012 at 18:38

1 Answer 1

1

Assuming you have on your page:

<div id="myResult"></div>

Then your onSuccess script function is simply:

function onSuccess(args) {
    document.getElementById("myResult").innerHTML = args;
}
Sign up to request clarification or add additional context in comments.

1 Comment

thanks, I will look into this method and report back. This should do it, I just need to fix one thing first before I can try this. Thanks again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.