Connecting Tech Pros Worldwide Help | Site Map

call webmethod masterpage

Newbie
 
Join Date: Aug 2009
Posts: 10
#1: Sep 14 '09
Dear All,

I have try to call the webmethod inside a master page browser close javascript function.It not working.

This is my scriptcode:
Expand|Select|Wrap|Line Numbers
  1. function BrowserClose()
  2. {
  3.        var getValues = "webmethod";
  4.        PageMethods.ClearValues(getValues,OnSucceeded);   
  5. function OnSucceeded(result)
  6. {      
  7.     alert(result);
  8. }
I call this BrowserClose() into onbeforeunload.


This is my webmethod:
Expand|Select|Wrap|Line Numbers
  1.  [System.Web.Services.WebMethod]
  2.     public static string ClearValues(string getValues)
  3.     {
  4.             string[] splitValue = getValues.Split('|');
  5.         string rowIndex = splitValue[0].ToString();
  6.         return "Its good if it works";
  7.  
  8.     }  
Is there any possiblity for calling the webmethod inside a masterpage

Thanks
Anitha
Reply