Remoting from Web Part
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
Remoting from Web Part

 
Post new topic   Reply to topic    Windows Server Forum Index -> Portal Server Development
Author Message
Eric Johnson
Guest





Posted: Mon Jan 03, 2005 9:37 pm    Post subject: Remoting from Web Part Reply with 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
Daniel Larson (www.portal
Guest





Posted: Wed Jan 05, 2005 6:39 am    Post subject: RE: Remoting from Web Part Reply with 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:

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 Reply with quote

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
 
Post new topic   Reply to topic    Windows Server Forum Index -> Portal Server Development All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB