asp.net - How can I use jQuery Ajax and PageMethods with instance variables? -


one reason use updatepanels doing our ajax because our bl , da layers pass around page.user.identity authentication.

is there way access this?

yes, can current user via httpcontext.current.user. msdn documentation page.user:

this property uses httpcontext object's user property determine request originates.

as broader question, "how can use jquery ajax , pagemethods instance variables?" answer "not directly."

no instance of page created when executing page method. (why asp.net ajax page methods have static? great conceptual overview of differences between normal page operations , static page methods). way access instance variables in page methods first put variables session during initial page request - rather fragile strategy: you're better off figuring out way data or values in question.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -