0

Is it possible to call a function within an asp.net web application from outside that application e.g. with VB.net? If so it would be great to see a hello world type example.

For arguments sake lets say I have my function "helloworld" in a class file within web application: http://server/helloworldapp

My ultimate goal is to enable some reliable / robust scheduling of functions within asp.net. I have read multiple examples about using web services / custom services running on the server etc but I don't really get the implementation.

Thanks

2 Answers 2

1

Based on the information in your question I cannot give you a out the box solution. But in general you can achieve this by multiple ways:

  1. Lift your class containing the method you want to call into a seperate class library, which you can share between the different apps you want.

  2. Expose the method as a webmethod through a webservice or pagemethod.

Sign up to request clarification or add additional context in comments.

4 Comments

I have to admit I am pretty new to .NET so it's probable I am not implementing the "best practice". I'll take a look into sharing class libraries as this sounds ideal. Thanks
Sorry I can't give you a better answer. Maybe you could update your question with a better description of the problem you try to solve. Add more information about the functionality you need, which kind of apps are involved, how the processing must be done, etc. Maybe then we could provide you a better answer.
To be honest what you have said is more than enough, it's given me the right path to look down. I'm going to shift my project around a bit now and I think I will easily be able to implement exactly what I am after.
Yeah just got to work out how to recode my project now! Thanks.
1

Make sure you have public methods in the asp.net class and you should be able to reference the web page dll from within your other vb.net project.

Though this really goes against best practices and you should try and isolate the method you are needing to reference into a separate business layer

1 Comment

+! That's exactly what I was going to say :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.