Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > PageMethod - What is needed to use them?

Reply
Thread Tools

PageMethod - What is needed to use them?

 
 
dnadeveloper
Guest
Posts: n/a
 
      07-06-2007
Can anyone tell me what is is required to get the PageMethod code into my
..aspx pages? (More accurately, into the rendered page.)
So far I have a scripmanager with EnablePageMethods wet to true.


TIA
Chris

 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=
Guest
Posts: n/a
 
      07-06-2007
Chris,

I think they must be static and mark with WebMethod attribute

[System.Web.Services.WebMethod()]
public static string GetUserName(int id)
{
return "Chris";
}

Hope this helps
--
Milosz


"dnadeveloper" wrote:

> Can anyone tell me what is is required to get the PageMethod code into my
> ..aspx pages? (More accurately, into the rendered page.)
> So far I have a scripmanager with EnablePageMethods wet to true.
>
>
> TIA
> Chris
>
>

 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=
Guest
Posts: n/a
 
      07-06-2007
I forgot there's another attribute you need to apply,

[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public static string GetUserName(int id)
{
return "Chris";
}

Now it should work
--
Milosz


"Milosz Skalecki [MCAD]" wrote:

> Chris,
>
> I think they must be static and mark with WebMethod attribute
>
> [System.Web.Services.WebMethod()]
> public static string GetUserName(int id)
> {
> return "Chris";
> }
>
> Hope this helps
> --
> Milosz
>
>
> "dnadeveloper" wrote:
>
> > Can anyone tell me what is is required to get the PageMethod code into my
> > ..aspx pages? (More accurately, into the rendered page.)
> > So far I have a scripmanager with EnablePageMethods wet to true.
> >
> >
> > TIA
> > Chris
> >
> >

 
Reply With Quote
 
dnadeveloper
Guest
Posts: n/a
 
      07-06-2007
"Milosz Skalecki [MCAD]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I forgot there's another attribute you need to apply,
>
> [System.Web.Services.WebMethod]
> [System.Web.Script.Services.ScriptMethod]
> public static string GetUserName(int id)
> {
> return "Chris";
> }
>
> Now it should work
> --
> Milosz
>
>
> "Milosz Skalecki [MCAD]" wrote:
>
>> Chris,


Thank you. All is good!




>>
>> I think they must be static and mark with WebMethod attribute
>>
>> [System.Web.Services.WebMethod()]
>> public static string GetUserName(int id)
>> {
>> return "Chris";
>> }
>>
>> Hope this helps
>> --
>> Milosz
>>
>>
>> "dnadeveloper" wrote:
>>
>> > Can anyone tell me what is is required to get the PageMethod code into
>> > my
>> > ..aspx pages? (More accurately, into the rendered page.)
>> > So far I have a scripmanager with EnablePageMethods wet to true.
>> >
>> >
>> > TIA
>> > Chris
>> >
>> >


 
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
Ajax, Webmethod, PageMethod (multiple versions) Rory Becker ASP .Net 8 08-04-2008 01:58 AM
First AJAX PageMethod blocks second page method from executing =?Utf-8?B?Um9nZXIgTWFydGlu?= ASP .Net 3 07-26-2007 10:48 PM
First PageMethod blocks second page method from executing =?Utf-8?B?Um9nZXIgTWFydGlu?= ASP .Net 3 07-23-2007 09:02 PM
Advise needed re Olympus Camedia C-3030 Zoom Camera (driver needed) Arawak Computer Support 2 11-18-2004 03:03 PM
Microsoft small business server 2003 - help needed to understand what is needed to use it Dima Computer Support 5 10-20-2004 08:27 PM



Advertisments