Showing posts with label returns. Show all posts
Showing posts with label returns. Show all posts

Wednesday, March 28, 2012

PageMethods in UserControl

Sorry if this has been asked before, but the search on the forum does not appear to be working. Everything returns "no results" even a search on "atlas"Smile [:)].

Anyway, is it possible to have web methods in a usercontrol and call them from javacript. I have successfully implemented the PageMethods.SomeMethod from a page but not from a User Control.

Anyone know how to do this?

Thanks,

Joe

No, PageMethods on user controls are not supported.


Will PageMethods be supported the future. I was planning on using PageMethods in controls, to me this would make sense to have.

Thanks.

hello.

i'm tented to say that it won't happen...though i might be wrong...


If there is some callback functionality that you need to use on different pages throughout your site, the best way forward would be to use the asmx web service model. This is much easier than it sounds, and the tutorial is great.

This model is more efficient than PageMethods, where ASP.NET has to initialise a Page instance from viewstate/http to get access to the method you need.

It seems to me that UpdatePanel and PageMethods have been included primarily because of ease of integration into existing sites. If you have the time to optimise, however, then the web service model is the way to go...

Cheers,
Carlos
Hi, thanks for the informaiton. can you send me an example how to use webservice model with user controls..

Monday, March 26, 2012

PageRequestManagerParserErrorException

I get PageRequestManagerParserErrorException

when a use :

Roles

.GetRolesForUser();

it returns a good string[] but a get a alart from ajax

can I trapp this Exception or can I fix this in som config

Crying

This is a know issue. Look at this post for details:

http://forums.asp.net/thread/1555817.aspx


This is a known issue. Look at this post for details:

http://forums.asp.net/thread/1555817.aspx


yes i also use

EnableEventValidation

="false"

but can i trapp application exceptions in ajax not just clear it on server sideStick out tongue