Pagemethods with AJAX

G

George Ter-Saakov

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.
 
G

George Ter-Saakov

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top