.NETGURU
ASP Request Object FROM .NET
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.component_services.

Post a new message to this list...

Lovet
Hi All,

I have created a .NET Component and by using rgsvcs.exe i'll be keeping that
component in COM+. This component is gets created by both ASPX and ASP
Pages. Everything works fine in .NET(aspx) side. My Problem is i am not able
to get the reference to ASP Request Object when this component is called by
ASP Page. Code is as follows

if (HttpContext.Current != null) /* ASPX call */

{

System.Web.HttpCookie oLoginCookie =
HttpContext.Current.Request.Cookies["LoginInfo"];

if (oLoginCookie != null)

{

_xmlDoc = new XmlDocument();

_xmlDoc.LoadXml(oLoginCookie.Value.ToString());

}

else

return string.Empty;

}

else /* ASP call */

{

Request oRequest = (Request)
ContextUtil.GetNamedProperty("Request");

if (oRequest == null)

return "hello"; // Always Returns "hello"

else

return "bolo";

}

Any Suggestions?

Thanks a lot

Reply to this message...
 
    
Dave Driver [MS]
Is your application a library application or a server app? Is the component
pooled?

If you are using a server app, then you should take a look at
http://www.gotdotnet.com/team/xmlentsvcs/esfaq.aspx#13.1.

--
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.
This posting is provided \"AS IS\" with no warranties, and confers no
rights.

"Lovet" <Click here to reveal e-mail address> wrote in message
news:e8Mxq#jdCHA.1732@tkmsftngp08...
[Original message clipped]

Reply to this message...
 
    
Lovet
Hi Dave,
It's a library application and component is not pooled.
Lovet

"Dave Driver [MS]" <Click here to reveal e-mail address> wrote in message
news:#YhCv1tdCHA.2424@tkmsftngp09...
> Is your application a library application or a server app? Is the
component
[Original message clipped]

Reply to this message...
 
    
Dave Driver [MS]
Make sure you have the [IISIntrinsics] attribute on your ServicedComponent.

--
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.
This posting is provided \"AS IS\" with no warranties, and confers no
rights.

"Lovet" <Click here to reveal e-mail address> wrote in message
news:uTr3MKudCHA.1820@tkmsftngp12...
[Original message clipped]

Reply to this message...
 
    
Lovet
Hai Dave,
yea, i have set IISIntrinsics property as follows
[IISIntrinsics]

[Transaction(TransactionOption.Required)]

public class LoginNET:System.EnterpriseServices.ServicedComponent

{

}

"Dave Driver [MS]" <Click here to reveal e-mail address> wrote in message
news:u$deAoudCHA.2616@tkmsftngp09...
> Make sure you have the [IISIntrinsics] attribute on your
ServicedComponent.
[Original message clipped]

Reply to this message...
 
    
Dhaval Shah
Hello,

The problem I am having is my application hangs at the point it trys to get the request object.
It only hangs when it is being run as a Server instead of library.
I am running the 1.0375 framework.

here is what the code looks like:
< _
Transaction(TransactionOption.Supported), _
CLSCompliant(True), _
ObjectPooling(Enabled:=True), _
EventTrackingEnabled(True), _
JustInTimeActivation(True), _
IISIntrinsics(True)> _
Public Class QuoteUtil
Inherits ServicedComponent

Public Function CloneQuote(ByVal ndcFile As String) As String Implements
Dim req As HttpRequest
Dim aspReq As ASPTypeLibrary.Request

Try
'It hangs at this call: ContextUtil.GetNamedProperty("Request")

If (ContextUtil.GetNamedProperty("Request") Is Nothing) Then
Throw New Exception("<ERROR ID='1'>Its nothing</ERROR>")
Else
Throw New Exception("<ERROR ID='1'>Its something</ERROR>")
End If
catch e as Excetion
throw e
End Try
End Function
End class

--------------------------------
From: Dhaval Shah
Reply to this message...
 
    
Dhaval Shah
Hello,

The problem I am having is my application hangs at the point it trys to get the request object.
It only hangs when it is being run as a Server instead of library.
I am running the 1.0375 framework.

here is what the code looks like:
< _
Transaction(TransactionOption.Supported), _
CLSCompliant(True), _
ObjectPooling(Enabled:=True), _
EventTrackingEnabled(True), _
JustInTimeActivation(True), _
IISIntrinsics(True)> _
Public Class QuoteUtil
Inherits ServicedComponent

Public Function CloneQuote(ByVal ndcFile As String) As String Implements
Dim req As HttpRequest
Dim aspReq As ASPTypeLibrary.Request

Try
'It hangs at this call: ContextUtil.GetNamedProperty("Request")

If (ContextUtil.GetNamedProperty("Request") Is Nothing) Then
Throw New Exception("<ERROR ID='1'>Its nothing</ERROR>")
Else
Throw New Exception("<ERROR ID='1'>Its something</ERROR>")
End If
catch e as Excetion
throw e
End Try
End Function
End class

--------------------------------
From: Dhaval Shah
Reply to this message...
 
 
System.EnterpriseServices.ContextUtil
System.EnterpriseServices.ServicedComponent
System.EnterpriseServices.TransactionOption
System.Web.HttpContext
System.Web.HttpCookie
System.Web.HttpRequest
System.Xml.XmlDocument




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification