<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>ASP.NET AJAX Networking and Web Services</title><link>http://forums.asp.net/1009.aspx</link><description>Discuss your issues with the client and server interaction in AJAX using web services and other transports used by AJAX</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: PageMethods is undefined. ???</title><link>http://forums.asp.net/thread/3273364.aspx</link><pubDate>Fri, 03 Jul 2009 11:09:09 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3273364</guid><dc:creator>Vince Xu - MSFT</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3273364.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1009&amp;PostID=3273364</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;What&amp;#39;s the error you encountered then? Client or server error.&lt;/p&gt;
&lt;p&gt;1.Please define pagemethod in the current page (aspx or code behind), rather than defining in usercontrol or other page.&lt;/p&gt;
&lt;p&gt;2.Set EnablePageMethod=true.&lt;/p&gt;
&lt;p&gt;3. Define the PageMethod method as static method.(In C#, use &amp;quot;Static&amp;quot;; in VB.Net, use Shared)&lt;/p&gt;
&lt;p&gt;4. Mark as web method&lt;/p&gt;
&lt;p&gt;If it can find PageMethod and pop out programe error, it maybe your code is incorrect in page method. Please debug it.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: PageMethods is undefined. ???</title><link>http://forums.asp.net/thread/3270234.aspx</link><pubDate>Thu, 02 Jul 2009 03:54:58 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3270234</guid><dc:creator>Kusno</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3270234.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1009&amp;PostID=3270234</wfw:commentRss><description>&lt;p&gt;it&amp;#39;s still not working &lt;img src="http://forums.asp.net/tiny_mce/jscripts/tiny_mce/plugins/emotions/img/smiley-cry.gif" alt="Cry" title="Cry" border="0" /&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: PageMethods is undefined. ???</title><link>http://forums.asp.net/thread/3268102.aspx</link><pubDate>Wed, 01 Jul 2009 06:52:31 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3268102</guid><dc:creator>Vince Xu - MSFT</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3268102.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1009&amp;PostID=3268102</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi,&lt;/p&gt;
&lt;p&gt;PageMethod is a static method, please define your page method to Shared method in VB, besides defining enablePageMethods=true&lt;/p&gt;</description></item><item><title>Re: PageMethods is undefined. ???</title><link>http://forums.asp.net/thread/3267240.aspx</link><pubDate>Tue, 30 Jun 2009 18:30:27 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3267240</guid><dc:creator>gt1329a</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3267240.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1009&amp;PostID=3267240</wfw:commentRss><description>&lt;p&gt;&lt;span&gt;Public &lt;b&gt;Shared&lt;/b&gt; Function&amp;nbsp;GetSum&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Re: PageMethods is undefined. ???</title><link>http://forums.asp.net/thread/3265376.aspx</link><pubDate>Tue, 30 Jun 2009 02:24:42 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3265376</guid><dc:creator>Kusno</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3265376.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1009&amp;PostID=3265376</wfw:commentRss><description>&lt;p&gt;I have changed it, but the error is still same &lt;img src="http://forums.asp.net/tiny_mce/jscripts/tiny_mce/plugins/emotions/img/smiley-cry.gif" alt="Cry" title="Cry" border="0" /&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: PageMethods is undefined. ???</title><link>http://forums.asp.net/thread/3263462.aspx</link><pubDate>Mon, 29 Jun 2009 07:24:16 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3263462</guid><dc:creator>qwe123kids</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3263462.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1009&amp;PostID=3263462</wfw:commentRss><description>&lt;p&gt;Hi,&lt;br /&gt;Check the setting script manager Settings&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:ScriptManager &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EnablePageMethods=&amp;quot;true&amp;quot; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ID=&amp;quot;MainSM&amp;quot; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; runat=&amp;quot;server&amp;quot; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ScriptMode=&amp;quot;Release&amp;quot; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LoadScriptsBeforeUI=&amp;quot;true&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/asp:ScriptManager&amp;gt;&lt;br /&gt;&lt;br /&gt;Or&lt;br /&gt;&lt;br /&gt;http://blog.devarchive.net/2007/12/calling-page-methods-from-javascript.html&lt;br /&gt;&lt;br /&gt;http://blog.devarchive.net/2008/01/calling-page-methods-from-javascript-by.html&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Or&lt;/p&gt;&lt;p&gt;Install Ajax Framework&lt;br /&gt;&lt;/p&gt;</description></item><item><title>PageMethods is undefined. ???</title><link>http://forums.asp.net/thread/3263411.aspx</link><pubDate>Mon, 29 Jun 2009 07:01:09 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3263411</guid><dc:creator>Kusno</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3263411.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1009&amp;PostID=3263411</wfw:commentRss><description>&lt;p&gt;I got this source code from internet.&lt;br /&gt;This source purpose is to call ASP.Net function or method from JavaScript.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;pre name="code" class="xhtml"&gt;&amp;lt;%@ Page Language=&amp;quot;VB&amp;quot; AutoEventWireup=&amp;quot;false&amp;quot; CodeFile=&amp;quot;Default5.aspx.vb&amp;quot; Inherits=&amp;quot;Default5&amp;quot; %&amp;gt;
&amp;lt;%@ Register Assembly=&amp;quot;System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&amp;quot; Namespace=&amp;quot;System.Web.UI&amp;quot; TagPrefix=&amp;quot;asp&amp;quot; %&amp;gt;

&amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot; &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&amp;gt;
&amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;gt;
&amp;lt;head id=&amp;quot;Head1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;
    &amp;lt;title&amp;gt;Developed by Awais Hafeez&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;script language=&amp;quot;javascript&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;
    function CalcSum(Src)
    {
        if (document.getElementById(&amp;quot;&amp;lt;%= txtFirstNo.ClientID %&amp;gt;&amp;quot;).value != &amp;#39;&amp;#39; &amp;amp;&amp;amp; document.getElementById(&amp;quot;&amp;lt;%= txtSecNo.ClientID %&amp;gt;&amp;quot;).value != &amp;#39;&amp;#39;)
        {
            PageMethods.getSum(document.getElementById(&amp;quot;&amp;lt;%= txtFirstNo.ClientID %&amp;gt;&amp;quot;).value, document.getElementById(&amp;quot;&amp;lt;%= txtSecNo.ClientID %&amp;gt;&amp;quot;).value, FillSumBox);
        }
    }
    function FillSumBox(val)
    {
        document.getElementById(&amp;quot;&amp;lt;%= txtSum.ClientID %&amp;gt;&amp;quot;).value = val;
    }
&amp;lt;/script&amp;gt;
    &amp;lt;form id=&amp;quot;form1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;
        &amp;lt;asp:ScriptManager ID=&amp;quot;ScriptManager1&amp;quot; runat=&amp;quot;server&amp;quot; EnablePartialRendering=&amp;quot;true&amp;quot; EnablePageMethods=&amp;quot;true&amp;quot;&amp;gt;
        &amp;lt;/asp:ScriptManager&amp;gt;
    &amp;lt;div&amp;gt; 
        &amp;lt;table align=&amp;quot;center&amp;quot; bgcolor=&amp;quot;#FFFFCC&amp;quot; width=&amp;quot;50%&amp;quot;&amp;gt;
            &amp;lt;tr&amp;gt;
                &amp;lt;td align=&amp;quot;center&amp;quot; colspan=&amp;quot;4&amp;quot;&amp;gt;
                    &amp;lt;b&amp;gt;Calling Web Methods from Client-Side&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;
            &amp;lt;/tr&amp;gt;
            &amp;lt;tr&amp;gt;
                &amp;lt;td align=&amp;quot;right&amp;quot;&amp;gt;
                    &amp;lt;/td&amp;gt;
                &amp;lt;td width=&amp;quot;5&amp;quot;&amp;gt;
                    &amp;lt;/td&amp;gt;
                &amp;lt;td&amp;gt;
                    &amp;lt;/td&amp;gt;
                &amp;lt;td&amp;gt;
                   &amp;lt;/td&amp;gt;
            &amp;lt;/tr&amp;gt;
            &amp;lt;tr&amp;gt;
                &amp;lt;td align=&amp;quot;right&amp;quot;&amp;gt;
                    &amp;lt;asp:Label ID=&amp;quot;Label1&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;First Number :&amp;quot;&amp;gt;&amp;lt;/asp:Label&amp;gt;
                &amp;lt;/td&amp;gt;
                &amp;lt;td&amp;gt;
                 &amp;lt;/td&amp;gt;
                &amp;lt;td&amp;gt;
                    &amp;lt;asp:TextBox ID=&amp;quot;txtFirstNo&amp;quot; onchange=&amp;quot;CalcSum(this)&amp;quot; runat=&amp;quot;server&amp;quot; MaxLength=&amp;quot;4&amp;quot;&amp;gt;&amp;lt;/asp:TextBox&amp;gt;
                &amp;lt;/td&amp;gt;
                &amp;lt;td&amp;gt;
                    &amp;lt;/td&amp;gt;
            &amp;lt;/tr&amp;gt;
            &amp;lt;tr&amp;gt;
                &amp;lt;td align=&amp;quot;right&amp;quot;&amp;gt;
                    &amp;lt;asp:Label ID=&amp;quot;Label2&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;Second Number :&amp;quot;&amp;gt;&amp;lt;/asp:Label&amp;gt;
                &amp;lt;/td&amp;gt;
                &amp;lt;td&amp;gt;
             &amp;lt;/td&amp;gt;
                &amp;lt;td&amp;gt;
                    &amp;lt;asp:TextBox ID=&amp;quot;txtSecNo&amp;quot; onchange=&amp;quot;CalcSum(this)&amp;quot; runat=&amp;quot;server&amp;quot; MaxLength=&amp;quot;4&amp;quot;&amp;gt;&amp;lt;/asp:TextBox&amp;gt;
                &amp;lt;/td&amp;gt;
                &amp;lt;td&amp;gt;
                &amp;lt;/td&amp;gt;
            &amp;lt;/tr&amp;gt;
            &amp;lt;tr&amp;gt;
                &amp;lt;td align=&amp;quot;right&amp;quot;&amp;gt;
                    &amp;lt;asp:Label ID=&amp;quot;Label3&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;Sum of Numbers :&amp;quot;&amp;gt;&amp;lt;/asp:Label&amp;gt;
                &amp;lt;/td&amp;gt;
                &amp;lt;td&amp;gt;
                    &amp;lt;/td&amp;gt;
                &amp;lt;td&amp;gt;
                    &amp;lt;asp:TextBox ID=&amp;quot;txtSum&amp;quot; runat=&amp;quot;server&amp;quot; ReadOnly=&amp;quot;True&amp;quot;&amp;gt;&amp;lt;/asp:TextBox&amp;gt;
                &amp;lt;/td&amp;gt;
                &amp;lt;td&amp;gt;
             &amp;lt;/td&amp;gt;
            &amp;lt;/tr&amp;gt;
        &amp;lt;/table&amp;gt;    
    &amp;lt;/div&amp;gt;
    &amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="vb.net"&gt;Imports System.Web
Imports System.Web.UI 
Imports System.Web.Services

Partial Class Default5
    Inherits System.Web.UI.Page

    &amp;lt;System.Web.Services.WebMethod()&amp;gt; _
    Public Function GetSum(ByVal num1 As Integer, ByVal num2 As Integer)
        Return (num1 + num2)
    End Function
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub
End Class&lt;/pre&gt;&lt;br /&gt; &lt;br /&gt;&lt;/pre&gt;&lt;p&gt;In JavaScript error listing, appeared like this : &lt;span style="color:;"&gt;&lt;b&gt;&amp;#39;PageMethods is undefined.&amp;#39;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Thanks.&lt;br /&gt; &lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>