Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Pagemethods with AJAX

Reply
Thread Tools

Pagemethods with AJAX

 
 
George Ter-Saakov
Guest
Posts: n/a
 
      08-28-2007
People, I am going crazy already

I have a page default.aspx where i am using Page Methods. Evetrything works
fine.
Now i want to create second page default2.aspx. in the same project/same
folder.
It gives me a JavaScript error PageMethods not defined.

I copied (CNTRL+A, CNTRL+C, CNTRL+A, CNTRL+V) everything from default1.aspx
into default2.aspx (no code behind).

Still not working. When i look at the source in HTML of default.aspx, line
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods=true
/>

generates PageMethods declaration in javascript.

When i am looking at the source of default2.aspx it's not there (although
ScriptManager line is in aspx with EnablePageMethods=true).



What am I missing? What could be the reason PageMethods not being defined.

thanks

George.


 
Reply With Quote
 
 
 
 
George Ter-Saakov
Guest
Posts: n/a
 
      08-28-2007
Well, found an answer.

1. the PageMethod must be declared as public static. Otherwise it will not
work. No errors except it gives PageMethods is not defined.
2. Project must be completely rebuild: menu/Rebuild Website. Otherwise it
will not work.


George.


"George Ter-Saakov" <gt-> wrote in message
news:...
> People, I am going crazy already
>
> I have a page default.aspx where i am using Page Methods. Evetrything
> works fine.
> Now i want to create second page default2.aspx. in the same project/same
> folder.
> It gives me a JavaScript error PageMethods not defined.
>
> I copied (CNTRL+A, CNTRL+C, CNTRL+A, CNTRL+V) everything from
> default1.aspx into default2.aspx (no code behind).
>
> Still not working. When i look at the source in HTML of default.aspx, line
> <asp:ScriptManager ID="ScriptManager1" runat="server"
> EnablePageMethods=true />
>
> generates PageMethods declaration in javascript.
>
> When i am looking at the source of default2.aspx it's not there (although
> ScriptManager line is in aspx with EnablePageMethods=true).
>
>
>
> What am I missing? What could be the reason PageMethods not being defined.
>
> thanks
>
> George.
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
move from ajax pro to pagemethods ton ASP .Net 4 12-22-2008 08:52 AM
Declaring PageMethods within Custom Web Control Damien ASP .Net 1 08-15-2007 06:27 PM
ajax pagemethods =?Utf-8?B?SmVycnkgQw==?= ASP .Net 2 08-14-2007 10:36 AM
Consuming PageMethods from the external client Michael Nemtsev ASP .Net 0 08-01-2007 04:39 PM
PageMethods script code as webresource germ ASP .Net 0 07-06-2007 01:26 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57