2009/5/5 Chilfrik <[email protected]>:
>
> I'm trying to call a .NET webmethod using prototype ajax (code below).
> but it does work. Is the code below the right approach?
>
> //Server side code
> [WebMethod]
> public string msgfromserver()
> {
> return "msgfromserver";
> }
>
> //Client side code
> function SendRequest(MSG)
> {
> document.getElementById("ResponseDiv").innerHTML="";
>
>
> new Ajax.Request("mydotnettest.aspx/msgfromserver",
> {
> method: "post",
> onSuccess: Successful,
> onFailure: Failed,
> onComplete: Respond
> });
>
>
> }
>
> >
>
Can you try this ...
function SendRequest(MSG)
{
$("ResponseDiv").innerHTML = '';
new Ajax.Updater
(
'ResponseDiv',
'mydotnettest.aspx/msgfromserver',
{
method : 'post'
}
);
}
--
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
"Standing on the shoulders of some very clever giants!"
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---