Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > code called from web page or webservice

Reply
Thread Tools

code called from web page or webservice

 
 
C Williams
Guest
Posts: n/a
 
      10-19-2005
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
 
Reply With Quote
 
 
 
 
S. Justin Gengo
Guest
Posts: n/a
 
      10-19-2005
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
"C Williams" <> wrote in message
news:%23nhr$...
> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is called carry chain structure in FPGA is called in IC? Weng Tianxiang VHDL 6 09-12-2007 07:19 AM
Refreshing page 1 after page 2 has been called from page 1 patrice.fiset@gmail.com Javascript 2 06-20-2007 10:13 PM
WebService called by automation dll times out when being called from Navision Felix ASP .Net Web Services 1 09-29-2006 01:43 PM
Page load of the parent page called twice when a modal dialog is opened from a button click of the user control on the parent page Samy ASP .Net 2 08-15-2005 03:30 PM
three times copy ctor called, one ctor called, why? Apricot C++ 4 04-16-2004 07:55 AM



Advertisments