| Author |
Message |
Eric Johnson
Guest
|
Posted:
Mon Jan 03, 2005 9:37 pm Post subject:
Remoting from Web Part |
|
|
I am developing a Web Part that needs Remoting (it is a client-activated
object).n I've done this before in asp.net by setting the remoting
configuration in the web.config file and loading that configuration in
global.asax.
If I try and set the remoting configuration in code in the Web Part, I have
to deal with making sure I don't register it multiple times on subsequent
requests. I was hoping to avoid what I figured would be a performance hit by
doing so (checking if the object is already registered for remoting; if not,
then create a channel and register it).
Is modifying global.asax recommended for Web Parts? If so, where exactly is
this located (I see several copies in the "web server extensions" directory
tree)?
Thanks for your help,
Eric |
|
| Back to top |
|
 |
Daniel Larson (www.portal
Guest
|
Posted:
Wed Jan 05, 2005 6:39 am Post subject:
RE: Remoting from Web Part |
|
|
Eric,
To use global.asax you'll need to drop your own copy into the web root
folder on the file system. Drop the code behind dll that global.asax inherits
from into the bin folder.
Daniel Larson
http://www.portalbuilder.org
"Eric Johnson" wrote:
| Quote: | I am developing a Web Part that needs Remoting (it is a client-activated
object).n I've done this before in asp.net by setting the remoting
configuration in the web.config file and loading that configuration in
global.asax.
If I try and set the remoting configuration in code in the Web Part, I have
to deal with making sure I don't register it multiple times on subsequent
requests. I was hoping to avoid what I figured would be a performance hit by
doing so (checking if the object is already registered for remoting; if not,
then create a channel and register it).
Is modifying global.asax recommended for Web Parts? If so, where exactly is
this located (I see several copies in the "web server extensions" directory
tree)?
Thanks for your help,
Eric
|
|
|
| Back to top |
|
 |
Eric Johnson
Guest
|
Posted:
Wed Jan 05, 2005 8:44 pm Post subject:
Re: Remoting from Web Part |
|
|
Thanks for the info. I actually ended up doing it in code as follows so
that the solution would be self-containing and not relying on other external
configuration files:
ActivatedClientTypeEntry activated =
RemotingConfiguration.IsRemotelyActivatedClientType(typeof(RemotingObject));
if (activated == null)
{
if (serverEndpoint.Trim().Length > 0)
{
ChannelServices.RegisterChannel(new TcpClientChannel());
RemotingConfiguration.RegisterActivatedClientType(typeof(RemotingObject),
serverEndpoint);
}
}
"Daniel Larson (www.portalbuilder.org)"
<daniel@larsontechnology.spamfree.com> wrote in message
news:377F7FE1-51D8-44C6-8C6B-99AB78C031C5@microsoft.com...
| Quote: | Eric,
To use global.asax you'll need to drop your own copy into the web root
folder on the file system. Drop the code behind dll that global.asax
inherits
from into the bin folder.
Daniel Larson
http://www.portalbuilder.org
"Eric Johnson" wrote:
I am developing a Web Part that needs Remoting (it is a client-activated
object).n I've done this before in asp.net by setting the remoting
configuration in the web.config file and loading that configuration in
global.asax.
If I try and set the remoting configuration in code in the Web Part, I
have
to deal with making sure I don't register it multiple times on subsequent
requests. I was hoping to avoid what I figured would be a performance hit
by
doing so (checking if the object is already registered for remoting; if
not,
then create a channel and register it).
Is modifying global.asax recommended for Web Parts? If so, where exactly
is
this located (I see several copies in the "web server extensions"
directory
tree)?
Thanks for your help,
Eric
|
|
|
| Back to top |
|
 |
|
|
|
|