code called from web page or webservice

C

C Williams

Hi,

I have a small piece of code that is used by both a web page and by a
web service. I'd like some different behaviour depending on whether it
is called by the page or by the service.

In the piece of code, I can determine the calling source (page/service)
by checking to see if System.Web.HttpContext.Current.Session is null
(which it will be for service and won't be for page).

The thing is--I would like for the piece of code to be able to look up a
bit of information at this point. For the page, that bit of information
is stored in the HttpSessionState. How can I store this information so
that when the code is called from the web service it can be looked up?

In this case, unfortunately, passing parameters directly isn't a good
option for me.

Thanks for any help you can give.

-Casey
 
S

S. Justin Gengo

Casey,

If you can't pass it to the page then I think storing it in a database
before calling the code and then having the code retrieve it from the
database would be your best option.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top