By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
463,048 Members | 429 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 463,048 IT Pros & Developers. It's quick & easy.

call webmethod masterpage

P: 11
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
Sep 14 '09 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.