Click here to Skip to main content
14,830,805 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to centralize some code execution which I have noticed repeated again and again in each of my project.


I want to centralize this repeated Code as Online Web API and instead of adding code, just want to make a single HTTP Request and then Response from it.

Problem : I have some code which is used for making some calculation. Now I have created another project in web forms and put that code there. This is online as "example.com/default.aspx".

But I want to send some data to it and then I want to retrieve a boolean result which will either true or False.

But I got stuck how to do it.
Posted

1 solution

Mark the method with <webmethod> attribute and you'll be able to call it by specifying its page and name (mypage.aspx/method_name)

You can send data via its parameters (note that this can be anything including objects so you can give it XML or context object with all needed data) and return the value normally as return from the method.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900