Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / August 2007

Tip: Looking for answers? Try searching our database.

Pagemethods with AJAX

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
George Ter-Saakov - 28 Aug 2007 20:59 GMT
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.
George Ter-Saakov - 28 Aug 2007 22:06 GMT
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.

> People, I am going crazy already
>
[quoted text clipped - 21 lines]
>
> George.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.