473,320 Members | 2,073 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

PageMethod - What is needed to use them?

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

Jul 6 '07 #1
3 5674
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

Jul 6 '07 #2
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
Jul 6 '07 #3
"Milosz Skalecki [MCAD]" <mi*****@DONTLIKESPAMwp.plwrote in message
news:23**********************************@microsof t.com...
>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

Jul 6 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: pekka niiranen | last post by:
Hi there, I have perl script that uses dynamically constructed regular in this way: ------perl code starts ---- $result ""; $key = AAA\?01; $key = quotemeta $key; $line = " ...
31
by: da Vinci | last post by:
OK, this has got to be a simple one and yet I cannot find the answer in my textbook. How can I get a simple pause after an output line, that simply waits for any key to be pressed to move on? ...
2
by: John Viele | last post by:
Every time I create ASP.NET pages that do any significant data access, I find myself having to deal with the same problems: managing data object creation, the SQL connection object especially. ...
67
by: Steven T. Hatton | last post by:
Some people have suggested the desire for code completion and refined edit-time error detection are an indication of incompetence on the part of the programmer who wants such features. ...
5
by: Steve | last post by:
Hi, I am sitting down to design our next set of internal apps. I would like to approach this in a way that would allow me to break logical parts of the application that handle specific tasks...
28
by: Ian Davies | last post by:
Hello I would appreciate some help from someone who has knowledge of working with css, php javascript and how they interact. Ive been working on a task for the last few days and have started to...
2
by: =?Utf-8?B?QmlnU2Ft?= | last post by:
I hope I'm in the correct forum. Please advise if I need to move this question. I've a lead developer who insists on developing with classic ASP & VB6. He & his team have created an impressive...
10
by: Montezuma's Daughter | last post by:
Hi All I was wondering why h file ia needed? why can't everything be written in C file? thanks
8
by: Rory Becker | last post by:
Hi All I have a need for an asp.net page to make a call to a server which it did not originate from when a button is clicked. A simple call to pass 2-3 params and return a result. I am happy...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.