views:

32

answers:

2

I am new to SilverLight and also web development. When the webserver application for the Silverlight app starts up I want to kick off some processes (server side) .. how do I do this .. there is no Main() or any other way I can see of doing this. I have a feeling it is to do with the html tag on the startup page which currently point to a .XAP file. If I want to instantiate a class called Startup when the server app begins .. how do I do this. I hope this is clear. It is the equivalent of a console app :

void Main() { Startup s = new Startup() }

+1  A: 

Person (Client) goes to webpage (Server).

Browser (Client) downloads Silverlight app XAP file (from Server)

Browser starts up Silverlight app (on client).

Silverlight App (client) can make calls to web server (server), not the other way around.

What is it exactly you are trying to accomplish?

rdkleine
As I said .. I essentially want to instantiate an object to do some background work when the server starts up .. not when a user client requests a silverlight app.I don't really want to get into the whys .. I am sure there is a standard way to do this .. (isn't there)
Adam
Your question was difficult to understand. Try Global.Asax HttpApplication.BeginRequest Event >> http://msdn.microsoft.com/en-us/library/1xaas8a2(VS.71).aspx
rdkleine
Oh and don't forget to accept answers now and again, ppl appreciate that.
rdkleine
Thank you rdkleineI believe Application_Start in Global.Asax is the answer.Need to do a little testing to make sure.It's late in New Zealand so will test in the morning.Can't see where to 'accept answers' .. or am I being thick !
Adam
You accept an answer by clicking on the empty check mark near the answer's reputation points (the number with up and down arrows above and below, respectively)
Andrei Rinea
Thanks for that .. it's not obvious then ... could be improved ..
Adam
A: 

The answer to the question .. "where do I put code that I want to run at startup" is the Global.asax file .. which is in the VS list when you go 'create new item'.

Adam