<?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 Discussion and Suggestions</title><link>http://forums.asp.net/1007.aspx</link><description>This forum is the place for ASP.NET AJAX 'getting started' questions, general questions that don't fit in one of the other forums about 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/2851482.aspx</link><pubDate>Wed, 07 Jan 2009 08:22:47 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2851482</guid><dc:creator>ponkarthik</dc:creator><author>ponkarthik</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2851482.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=2851482</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Thanks to all &lt;/p&gt;&lt;p&gt;this post is really helped for me..&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: PageMethods is undefined</title><link>http://forums.asp.net/thread/2753581.aspx</link><pubDate>Tue, 18 Nov 2008 20:32:18 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2753581</guid><dc:creator>inmykingdom</dc:creator><author>inmykingdom</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2753581.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=2753581</wfw:commentRss><description>&lt;p&gt;i don&amp;#39;t have the answer either, but you should use webservices instead of pagemethods instead. it&amp;#39;s a lot better. you&amp;#39;re pagemethod has to be static anyway, and webservices also read your cookies, so why not...&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.asp.net/Ajax/Documentation/Live/tutorials/ASPNETAJAXWebServicesTutorials.aspx"&gt;http://www.asp.net/Ajax/Documentation/Live/tutorials/ASPNETAJAXWebServicesTutorials.aspx&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Re: PageMethods is undefined</title><link>http://forums.asp.net/thread/2753479.aspx</link><pubDate>Tue, 18 Nov 2008 19:38:59 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2753479</guid><dc:creator>rmdw</dc:creator><author>rmdw</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2753479.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=2753479</wfw:commentRss><description>&lt;p&gt;I am by no means an expert with PageMethods - especially when things go wrong!&amp;nbsp; But if you have a small working version then I&amp;#39;d start from there and start expanding it, testing it every so often, until you get to the current codebase you have with this code you&amp;#39;ve provided.&amp;nbsp; Clearly something is missing but I&amp;#39;m not sure what.&lt;/p&gt;&lt;p&gt;Robert &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: PageMethods is undefined</title><link>http://forums.asp.net/thread/2752799.aspx</link><pubDate>Tue, 18 Nov 2008 14:18:50 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2752799</guid><dc:creator>XCellent</dc:creator><author>XCellent</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2752799.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=2752799</wfw:commentRss><description>&lt;p&gt;Hi,&lt;br /&gt;i hope someone is checking this thread and can help me out.&lt;br /&gt;The errormessage i get is in a lot of posts. &lt;br /&gt;Sometimes the people forget to EnablePagemethods or anything else but not here.&lt;br /&gt;Ok but anyway, lets come to the point.&lt;/p&gt;
&lt;p&gt;I&amp;nbsp;developed with ASP.NET and AJAX a little demo that runs fine.&lt;br /&gt;In this demo i use AJAX to retrieve the time by using a Pagemethod&lt;br /&gt;&lt;br /&gt;Afterwards i used the same code to implement a webpart&amp;nbsp;for WSS/Sharepoint.&lt;br /&gt;It seams perfect but if i try to call the webmethod by a click on the button i get the error &amp;quot;&amp;#39;Pagemethods&amp;#39; is undefined&amp;quot;&lt;/p&gt;
&lt;p&gt;The webmethod is not added to the generated html-sourcecode.&lt;br /&gt;&lt;br /&gt;Does anybody has an idea?&lt;br /&gt;I posted the quellcode below!&lt;br /&gt;&lt;br /&gt;Thx&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;pre class="coloredcode"&gt;&lt;b id="1"&gt;1    &lt;/b&gt;&lt;span class="kwd"&gt;using&lt;/span&gt; System;
&lt;b id="2"&gt;2    &lt;/b&gt;&lt;span class="kwd"&gt;using&lt;/span&gt; System.Runtime.InteropServices;
&lt;b id="3"&gt;3    &lt;/b&gt;&lt;span class="kwd"&gt;using&lt;/span&gt; System.Web.UI;
&lt;b id="4"&gt;4    &lt;/b&gt;&lt;span class="kwd"&gt;using&lt;/span&gt; System.Web.UI.WebControls;
&lt;b id="5"&gt;5    &lt;/b&gt;&lt;span class="kwd"&gt;using&lt;/span&gt; System.Web.UI.WebControls.WebParts;
&lt;b id="6"&gt;6    &lt;/b&gt;&lt;span class="kwd"&gt;using&lt;/span&gt; System.Xml.Serialization;
&lt;b id="7"&gt;7    &lt;/b&gt;&lt;span class="kwd"&gt;using&lt;/span&gt; System.Web.Services;
&lt;b id="8"&gt;8    &lt;/b&gt;
&lt;b id="9"&gt;9    &lt;/b&gt;&lt;span class="kwd"&gt;using&lt;/span&gt; Microsoft.SharePoint;
&lt;b id="10"&gt;10   &lt;/b&gt;&lt;span class="kwd"&gt;using&lt;/span&gt; Microsoft.SharePoint.WebControls;
&lt;b id="11"&gt;11   &lt;/b&gt;&lt;span class="kwd"&gt;using&lt;/span&gt; Microsoft.SharePoint.WebPartPages;
&lt;b id="12"&gt;12   &lt;/b&gt;
&lt;b id="13"&gt;13   &lt;/b&gt;&lt;span class="kwd"&gt;namespace&lt;/span&gt; LitwareWebParts
&lt;b id="14"&gt;14   &lt;/b&gt;{
&lt;b id="15"&gt;15   &lt;/b&gt;    [Guid(&lt;span class="st"&gt;&amp;quot;dde26c8c-6328-47e3-9635-5f77d1581a2c&amp;quot;&lt;/span&gt;)]
&lt;b id="16"&gt;16   &lt;/b&gt;    &lt;span class="kwd"&gt;public class&lt;/span&gt; AjaxTime : System.Web.UI.WebControls.WebParts.WebPart
&lt;b id="17"&gt;17   &lt;/b&gt;    {
&lt;b id="18"&gt;18   &lt;/b&gt;        &lt;span class="kwd"&gt;private&lt;/span&gt; TextBox txtTime;
&lt;b id="19"&gt;19   &lt;/b&gt;        &lt;span class="kwd"&gt;private&lt;/span&gt; Button btnUpdate;
&lt;b id="20"&gt;20   &lt;/b&gt;
&lt;b id="21"&gt;21   &lt;/b&gt;        &lt;span class="kwd"&gt;public&lt;/span&gt; AjaxTime()
&lt;b id="22"&gt;22   &lt;/b&gt;        {
&lt;b id="23"&gt;23   &lt;/b&gt;        }
&lt;b id="24"&gt;24   &lt;/b&gt;
&lt;b id="25"&gt;25   &lt;/b&gt;        &lt;span class="kwd"&gt;protected override void&lt;/span&gt; CreateChildControls()
&lt;b id="26"&gt;26   &lt;/b&gt;        {
&lt;b id="27"&gt;27   &lt;/b&gt;            &lt;span class="kwd"&gt;base&lt;/span&gt;.CreateChildControls();
&lt;b id="28"&gt;28   &lt;/b&gt;
&lt;b id="29"&gt;29   &lt;/b&gt;            &lt;span class="kwd"&gt;this&lt;/span&gt;.Controls.Add(&lt;span class="kwd"&gt;new&lt;/span&gt; LiteralControl(&lt;span class="st"&gt;&amp;quot;Uhrzeit zu der das Control geladen wurde: &amp;quot;&lt;/span&gt; + DateTime.Now.ToLongTimeString() + &lt;span class="st"&gt;&amp;quot;&amp;amp;lt;br /&amp;gt;&amp;quot;&lt;/span&gt;));
&lt;b id="30"&gt;30   &lt;/b&gt;
&lt;b id="31"&gt;31   &lt;/b&gt;            txtTime = &lt;span class="kwd"&gt;new&lt;/span&gt; TextBox();
&lt;b id="32"&gt;32   &lt;/b&gt;            txtTime.ReadOnly = &lt;span class="kwd"&gt;true&lt;/span&gt;;
&lt;b id="33"&gt;33   &lt;/b&gt;
&lt;b id="34"&gt;34   &lt;/b&gt;            btnUpdate = &lt;span class="kwd"&gt;new&lt;/span&gt; Button();
&lt;b id="35"&gt;35   &lt;/b&gt;            btnUpdate.Text = &lt;span class="st"&gt;&amp;quot;Aktualisieren&amp;quot;&lt;/span&gt;;
&lt;b id="36"&gt;36   &lt;/b&gt;            btnUpdate.OnClientClick = &lt;span class="st"&gt;&amp;quot;return getTime();&amp;quot;&lt;/span&gt;;
&lt;b id="37"&gt;37   &lt;/b&gt;
&lt;b id="38"&gt;38   &lt;/b&gt;            LiteralControl litButton = &lt;span class="kwd"&gt;new&lt;/span&gt; LiteralControl(&lt;span class="st"&gt;&amp;quot;&amp;amp;lt;input type=&amp;#39;button&amp;#39; value=&amp;#39;abfragen&amp;#39; onclick=&amp;#39;return getTime();&amp;#39; /&amp;gt;&amp;quot;&lt;/span&gt;);
&lt;b id="39"&gt;39   &lt;/b&gt;            &lt;span class="kwd"&gt;this&lt;/span&gt;.Controls.Add(litButton);
&lt;b id="40"&gt;40   &lt;/b&gt;
&lt;b id="41"&gt;41   &lt;/b&gt;            &lt;span class="kwd"&gt;this&lt;/span&gt;.Controls.Add(&lt;span class="kwd"&gt;this&lt;/span&gt;.txtTime);
&lt;b id="42"&gt;42   &lt;/b&gt;            &lt;span class="kwd"&gt;this&lt;/span&gt;.Controls.Add(&lt;span class="kwd"&gt;this&lt;/span&gt;.btnUpdate);
&lt;b id="43"&gt;43   &lt;/b&gt;
&lt;b id="44"&gt;44   &lt;/b&gt;            &lt;span class="kwd"&gt;string&lt;/span&gt; JavaScript = &lt;span class="kwd"&gt;null&lt;/span&gt;;
&lt;b id="45"&gt;45   &lt;/b&gt;            JavaScript += &lt;span class="st"&gt;&amp;quot;\n&amp;quot;&lt;/span&gt;;
&lt;b id="46"&gt;46   &lt;/b&gt;            JavaScript += &lt;span class="st"&gt;&amp;quot;function getTime()\n&amp;quot;&lt;/span&gt;;
&lt;b id="47"&gt;47   &lt;/b&gt;            JavaScript += &lt;span class="st"&gt;&amp;quot;{\n&amp;quot;&lt;/span&gt;;
&lt;b id="48"&gt;48   &lt;/b&gt;            JavaScript += &lt;span class="st"&gt;&amp;quot;     PageMethods.getActualTime(methodCompleted);\n&amp;quot;&lt;/span&gt;;
&lt;b id="49"&gt;49   &lt;/b&gt;            JavaScript += &lt;span class="st"&gt;&amp;quot;     return false;\n&amp;quot;&lt;/span&gt;;
&lt;b id="50"&gt;50   &lt;/b&gt;            JavaScript += &lt;span class="st"&gt;&amp;quot;}\n&amp;quot;&lt;/span&gt;;
&lt;b id="51"&gt;51   &lt;/b&gt;            JavaScript += &lt;span class="st"&gt;&amp;quot;\n&amp;quot;&lt;/span&gt;;
&lt;b id="52"&gt;52   &lt;/b&gt;            JavaScript += &lt;span class="st"&gt;&amp;quot;function methodCompleted(results, context, methodName)\n&amp;quot;&lt;/span&gt;;
&lt;b id="53"&gt;53   &lt;/b&gt;            JavaScript += &lt;span class="st"&gt;&amp;quot;{\n&amp;quot;&lt;/span&gt;;
&lt;b id="54"&gt;54   &lt;/b&gt;            JavaScript += &lt;span class="st"&gt;&amp;quot;     $get(&amp;#39;&amp;quot;&lt;/span&gt; + txtTime.ClientID + &lt;span class="st"&gt;&amp;quot;&amp;#39;).innerText=results;\n&amp;quot;&lt;/span&gt;;
&lt;b id="55"&gt;55   &lt;/b&gt;            JavaScript += &lt;span class="st"&gt;&amp;quot;}\n&amp;quot;&lt;/span&gt;;
&lt;b id="56"&gt;56   &lt;/b&gt;            JavaScript += &lt;span class="st"&gt;&amp;quot;\n&amp;quot;&lt;/span&gt;;
&lt;b id="57"&gt;57   &lt;/b&gt;
&lt;b id="58"&gt;58   &lt;/b&gt;            Page.ClientScript.RegisterStartupScript(&lt;span class="kwd"&gt;typeof&lt;/span&gt;(&lt;span class="kwd"&gt;string&lt;/span&gt;), &lt;span class="st"&gt;&amp;quot;getTime&amp;quot;&lt;/span&gt;, JavaScript,&lt;span class="kwd"&gt;true&lt;/span&gt;);
&lt;b id="59"&gt;59   &lt;/b&gt;        }
&lt;b id="60"&gt;60   &lt;/b&gt;
&lt;b id="61"&gt;61   &lt;/b&gt;        &lt;span class="kwd"&gt;private void&lt;/span&gt; EnsureScriptManager()
&lt;b id="62"&gt;62   &lt;/b&gt;        {
&lt;b id="63"&gt;63   &lt;/b&gt;            ScriptManager scriptManager = ScriptManager.GetCurrent(&lt;span class="kwd"&gt;this&lt;/span&gt;.Page);
&lt;b id="64"&gt;64   &lt;/b&gt;            &lt;span class="kwd"&gt;if&lt;/span&gt; (scriptManager == &lt;span class="kwd"&gt;null&lt;/span&gt;)
&lt;b id="65"&gt;65   &lt;/b&gt;            {
&lt;b id="66"&gt;66   &lt;/b&gt;                scriptManager = &lt;span class="kwd"&gt;new&lt;/span&gt; ScriptManager();
&lt;b id="67"&gt;67   &lt;/b&gt;                scriptManager.EnablePageMethods = &lt;span class="kwd"&gt;true&lt;/span&gt;;
&lt;b id="68"&gt;68   &lt;/b&gt;
&lt;b id="69"&gt;69   &lt;/b&gt;                &lt;span class="kwd"&gt;if&lt;/span&gt; (Page.Form != &lt;span class="kwd"&gt;null&lt;/span&gt;)
&lt;b id="70"&gt;70   &lt;/b&gt;                {
&lt;b id="71"&gt;71   &lt;/b&gt;                    Page.Form.Controls.AddAt(0, scriptManager);
&lt;b id="72"&gt;72   &lt;/b&gt;                }
&lt;b id="73"&gt;73   &lt;/b&gt;            }
&lt;b id="74"&gt;74   &lt;/b&gt;
&lt;b id="75"&gt;75   &lt;/b&gt;            scriptManager.EnablePageMethods = &lt;span class="kwd"&gt;true&lt;/span&gt;;
&lt;b id="76"&gt;76   &lt;/b&gt;        }
&lt;b id="77"&gt;77   &lt;/b&gt;
&lt;b id="78"&gt;78   &lt;/b&gt;        &lt;span class="kwd"&gt;private void&lt;/span&gt; EnsureUpdatePanelFixups()
&lt;b id="79"&gt;79   &lt;/b&gt;        {
&lt;b id="80"&gt;80   &lt;/b&gt;            &lt;span class="kwd"&gt;if&lt;/span&gt; (&lt;span class="kwd"&gt;this&lt;/span&gt;.Page.Form != &lt;span class="kwd"&gt;null&lt;/span&gt;)
&lt;b id="81"&gt;81   &lt;/b&gt;            {
&lt;b id="82"&gt;82   &lt;/b&gt;                &lt;span class="kwd"&gt;string&lt;/span&gt; formOnSubmitAtt = &lt;span class="kwd"&gt;this&lt;/span&gt;.Page.Form.Attributes[&lt;span class="st"&gt;&amp;quot;onsubmit&amp;quot;&lt;/span&gt;];
&lt;b id="83"&gt;83   &lt;/b&gt;                &lt;span class="kwd"&gt;if&lt;/span&gt; (formOnSubmitAtt == &lt;span class="st"&gt;&amp;quot;return _spFormOnSubmitWrapper();&amp;quot;&lt;/span&gt;)
&lt;b id="84"&gt;84   &lt;/b&gt;                {
&lt;b id="85"&gt;85   &lt;/b&gt;                    &lt;span class="kwd"&gt;this&lt;/span&gt;.Page.Form.Attributes[&lt;span class="st"&gt;&amp;quot;onsubmit&amp;quot;&lt;/span&gt;] = &lt;span class="st"&gt;&amp;quot;_spFormOnSubmitWrapper();&amp;quot;&lt;/span&gt;;
&lt;b id="86"&gt;86   &lt;/b&gt;                }
&lt;b id="87"&gt;87   &lt;/b&gt;            }
&lt;b id="88"&gt;88   &lt;/b&gt;            ScriptManager.RegisterStartupScript(&lt;span class="kwd"&gt;this&lt;/span&gt;, &lt;span class="kwd"&gt;this&lt;/span&gt;.GetType(), &lt;span class="st"&gt;&amp;quot;UpdatePanelFixup&amp;quot;&lt;/span&gt;, &lt;span class="st"&gt;&amp;quot;_spOriginalFormAction = document.forms[0].action; _spSuppressFormOnSubmitWrapper=true;&amp;quot;&lt;/span&gt;, &lt;span class="kwd"&gt;true&lt;/span&gt;);
&lt;b id="89"&gt;89   &lt;/b&gt;        }
&lt;b id="90"&gt;90   &lt;/b&gt;
&lt;b id="91"&gt;91   &lt;/b&gt;        &lt;span class="cmt"&gt;//        [WebMethod()]&lt;/span&gt;
&lt;b id="92"&gt;92   &lt;/b&gt;        [System.Web.Services.WebMethod()]
&lt;b id="93"&gt;93   &lt;/b&gt;        &lt;span class="kwd"&gt;public static string&lt;/span&gt; getActualTime()
&lt;b id="94"&gt;94   &lt;/b&gt;        {
&lt;b id="95"&gt;95   &lt;/b&gt;            &lt;span class="kwd"&gt;return&lt;/span&gt; DateTime.Now.ToLongTimeString();
&lt;b id="96"&gt;96   &lt;/b&gt;        }
&lt;b id="97"&gt;97   &lt;/b&gt;
&lt;b id="98"&gt;98   &lt;/b&gt;        &lt;span class="kwd"&gt;protected override void&lt;/span&gt; OnInit(EventArgs e)
&lt;b id="99"&gt;99   &lt;/b&gt;        {
&lt;b id="100"&gt;100  &lt;/b&gt;            &lt;span class="kwd"&gt;base&lt;/span&gt;.OnInit(e);
&lt;b id="101"&gt;101  &lt;/b&gt;
&lt;b id="102"&gt;102  &lt;/b&gt;            EnsureScriptManager();
&lt;b id="103"&gt;103  &lt;/b&gt;            EnsureUpdatePanelFixups();
&lt;b id="104"&gt;104  &lt;/b&gt;        }
&lt;b id="105"&gt;105  &lt;/b&gt;    }
&lt;b id="106"&gt;106  &lt;/b&gt;}
&lt;b id="107"&gt;107  &lt;/b&gt;
&lt;/pre&gt;&amp;nbsp;</description></item><item><title>Re: PageMethods is undefined</title><link>http://forums.asp.net/thread/2718172.aspx</link><pubDate>Sat, 01 Nov 2008 05:19:33 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2718172</guid><dc:creator>rmdw</dc:creator><author>rmdw</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2718172.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=2718172</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m hoping some are still checking this thread.&amp;nbsp; My situation is similar but with a caveat.&amp;nbsp; I did have my PageMethod working, when it resided on the Content Page.&amp;nbsp; I&amp;#39;m now trying to get it working on my Master Page and am getting the same &amp;quot;PageMethods is undefined&amp;quot; error.&lt;/p&gt;&lt;p&gt;Here&amp;#39;s my code:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;lt;script language=&amp;quot;javascript&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; function CheckForNewSessionData()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PageMethods.ProtectNewSessionData(OnSucceeded, OnFailed);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setTimeout(&amp;#39;CheckForNewSessionData()&amp;#39;, 6000);&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; function OnSucceeded(result, userContext, methodName)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // In this current implementation we will do nothing here&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; function OnFailed(error, userContext, methodName)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // In this current implementation we will do nothing here&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;lt;/script&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; [WebMethod]&lt;br /&gt;&amp;nbsp; public static void ProtectNewSessionData()&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; object isNewSessionData = HttpContext.Current.Session[&amp;quot;IsNewSessionData&amp;quot;];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (isNewSessionData != null &amp;amp;&amp;amp; (bool)isNewSessionData)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BusinessObjects.SessionData.StoreSessionVariables(HttpContext.Current.Session);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SessionData.SaveSessionObject(&amp;quot;IsNewSessionData&amp;quot;, false);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I&amp;#39;m wondering if it&amp;#39;s not permissible to use a WebMethod on a Master Page?&lt;/p&gt;&lt;p&gt;Robert&lt;/p&gt;&lt;p&gt;&amp;nbsp;&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/2715219.aspx</link><pubDate>Thu, 30 Oct 2008 17:56:31 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2715219</guid><dc:creator>MisterFantastic</dc:creator><author>MisterFantastic</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2715219.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=2715219</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi All,&lt;/p&gt;&lt;p&gt;&amp;nbsp;This post is very much useful for me .Thanks &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: PageMethods is undefined</title><link>http://forums.asp.net/thread/2428943.aspx</link><pubDate>Tue, 17 Jun 2008 17:19:27 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2428943</guid><dc:creator>Rupesh Bhatia</dc:creator><author>Rupesh Bhatia</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2428943.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=2428943</wfw:commentRss><description>&lt;p&gt;Yes i have added it in Scriptmanager...&lt;/p&gt;
&lt;p&gt;&amp;nbsp;function is made public and static (shared) ...but it showed me error on lines within the function as i am calling some other functions from that function.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Rupesh Bhatia&lt;/p&gt;</description></item><item><title>Re: PageMethods is undefined</title><link>http://forums.asp.net/thread/2428904.aspx</link><pubDate>Tue, 17 Jun 2008 17:00:41 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2428904</guid><dc:creator>nikhilzkingdom</dc:creator><author>nikhilzkingdom</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2428904.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=2428904</wfw:commentRss><description>&lt;p&gt;Is the method public?&lt;/p&gt;
&lt;p&gt;Do you have EnablePageMethods=&amp;quot;true&amp;quot; on the scriptmanager?&lt;/p&gt;</description></item><item><title>Re: PageMethods is undefined</title><link>http://forums.asp.net/thread/2428867.aspx</link><pubDate>Tue, 17 Jun 2008 16:47:30 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2428867</guid><dc:creator>Rupesh Bhatia</dc:creator><author>Rupesh Bhatia</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2428867.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=2428867</wfw:commentRss><description>&lt;p&gt;Can Someone please post an example of PageMethods used with Static Functions on server side in VB.net&lt;/p&gt;
&lt;p&gt;I tried defining and declaring the server side function as Static but is didn&amp;#39;t worked......maybe i went somewhere wrong.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Rupesh Bhatia&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&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/2428729.aspx</link><pubDate>Tue, 17 Jun 2008 15:47:56 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2428729</guid><dc:creator>nikhilzkingdom</dc:creator><author>nikhilzkingdom</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2428729.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=2428729</wfw:commentRss><description>&lt;p&gt;In order for PageMethods to work, the method needs to be a static method of the page class (and hence was designed to not allow access to the Page lifecycle or controls collection)&lt;/p&gt;</description></item><item><title>Re: PageMethods is undefined</title><link>http://forums.asp.net/thread/2427750.aspx</link><pubDate>Tue, 17 Jun 2008 09:53:04 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2427750</guid><dc:creator>Rupesh Bhatia</dc:creator><author>Rupesh Bhatia</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2427750.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=2427750</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;An alternative to using PageMethods was do Postback of UpdatePanel and do your functionality.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Following worked for me...&lt;/p&gt;&lt;p&gt;__doPostback(&amp;#39;UpdatePanel1&amp;#39;,&amp;#39;&amp;#39;);&amp;nbsp;&lt;/p&gt;&lt;p&gt;Regards,&lt;/p&gt;&lt;p&gt;Rupesh Bhatia&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: PageMethods is undefined</title><link>http://forums.asp.net/thread/2427433.aspx</link><pubDate>Tue, 17 Jun 2008 07:29:27 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2427433</guid><dc:creator>Rupesh Bhatia</dc:creator><author>Rupesh Bhatia</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2427433.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=2427433</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi Al,&lt;/p&gt;&lt;p&gt;Am having sliders on my page which are created on client side in Init function thru javascript.&lt;/p&gt;&lt;p&gt;I have attached the bsCaratChange function with one of the sliders....to show the values changed in a textbox.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I want to call a server side function&amp;nbsp; on this change of value in textbox.&lt;/p&gt;&lt;p&gt;I have made tht server side function as a WebMethod and trying to call it from javascript&lt;/p&gt;&lt;p&gt;But am getting &amp;quot;PageMethods is undefined.&amp;quot;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Here is my code.&lt;/p&gt;&lt;p&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;SliderCarat.attachOnChange(bsCaratChange);&amp;nbsp;&lt;/p&gt;&lt;p&gt;function bsCaratChange(sliderObj, val, newPos, knobNumber) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.getElementById(&amp;#39;SliderCaratknob&amp;#39;+knobNumber).value = val;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PageMethods.LoadGrid();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/p&gt;&lt;p&gt;&amp;lt;/script&amp;gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;lt;form&amp;gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;,&lt;/p&gt;&lt;p&gt;,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;lt;asp:ScriptManager ID=&amp;quot;ScriptManager1&amp;quot; runat=&amp;quot;server&amp;quot; EnablePageMethods=&amp;quot;true&amp;quot;/&amp;gt;&lt;/p&gt;&lt;p&gt;,&lt;/p&gt;&lt;p&gt;,&lt;/p&gt;&lt;p&gt;,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;lt;/form&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Server Side code.................................&lt;/p&gt;&lt;p&gt;&amp;nbsp;Imports System.Text&lt;br /&gt;Imports System.Data.SqlClient&lt;br /&gt;Imports System.IO&lt;br /&gt;Imports System&lt;br /&gt;Imports system.web.Services.WebMethod&lt;br /&gt;Imports System.Data&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;lt;System.Web.Services.WebMethod()&amp;gt; _&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Function LoadGrid()&lt;/p&gt;&lt;p&gt;...Code....&amp;nbsp;&lt;/p&gt;&lt;p&gt;End function&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Kindly let me know if am misssing out somewhere...any suggestions/alternatives will be appreciated.&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: PageMethods is undefined</title><link>http://forums.asp.net/thread/1857735.aspx</link><pubDate>Tue, 14 Aug 2007 16:58:23 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1857735</guid><dc:creator>nikhilzkingdom</dc:creator><author>nikhilzkingdom</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1857735.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=1857735</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;also page methods needs to be static in code behind&lt;/p&gt;&lt;p&gt;&amp;nbsp;[WebMethod]&lt;/p&gt;&lt;p&gt;public static bool foo&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: PageMethods is undefined</title><link>http://forums.asp.net/thread/1856019.aspx</link><pubDate>Mon, 13 Aug 2007 23:18:11 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1856019</guid><dc:creator>Steve Marx</dc:creator><author>Steve Marx</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1856019.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=1856019</wfw:commentRss><description>&lt;p&gt;I believe you need EnablePageMethods=&amp;quot;true&amp;quot; on your ScriptManager.&lt;/p&gt;</description></item><item><title>Re: PageMethods is undefined</title><link>http://forums.asp.net/thread/1855173.aspx</link><pubDate>Mon, 13 Aug 2007 15:26:20 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1855173</guid><dc:creator>inmykingdom</dc:creator><author>inmykingdom</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1855173.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=1855173</wfw:commentRss><description>&lt;p&gt;i was getting the same error message,&lt;/p&gt;
&lt;p&gt;my fault was that i was using a usercontrol, and the PageMethod needs to be declared on the PAGE, not on the usercontrol used in the page&lt;/p&gt;</description></item></channel></rss>