Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: RE: Application Error: Request is not available in this context


Message #1 by =?iso-8859-1?Q?Fredrik_Norm=E9n?= <fredrik.normen@e...> on Tue, 2 Jan 2001 10:06:08 +0100
example:



If you create a cookie in the directory myApp/test

you can't get the value from the same cookie in the directory myApp/test2.

You can only get the value from the cookie in the sub directories to

myApp/test and in the myApp/test directory.



So if your ASP.NET page is not located in the sub directory or in the same

driectory there the cookie was created, you will have problems to get the

value from the cookie.



/Fredrik Normén



-----Original Message-----

From: levent camlibel [mailto:lcamlib@c...]

Sent: den 26 december 2000 03:59

To: ASP+

Subject: [aspx] Application Error: Request is not available in this

context





Hello All,



I get the following error. "request is not available on this context".

However, SQL statement works in other pages but this

one. I could not figure out why it is not working in this page. As I

know,

Request.Cookies["Firm_ID"].Value.ToString() has value and I can get

this value in other pages with the same statement.

Some help will be appreciated.



Application Error

----------------------------------------------------------------------------

----





Request is not available in this context

Description: An unhandled exception occurred at runtime during the

execution

of the current web request. Please review the stack trace below to get a

better

understanding of what the error is and where it originated from in the

code.



Exception Details: System.Web.HttpException: Request is not available in

this

context



Source Error:





Line 177:               {

Line 178:                               string strSQL;

Line 179:                               strSQL="SELECT

PRODUCT_CATEGORY_ID,

PRODUCT_CATEGORY_NAME from product_category WHERE

Firm_ID="+Request.Cookies["Firm_ID"].Value.ToString()+" ORDER BY

PRODUCT_CATEGORY_NAME";

Line 180:

Line 181:

txtFirmName.Text=Request.Cookies["Firm_Name"].Value.ToString();





Source File: c:\inetpub\wwwroot\supplynet\spnetproducts.cs    Line: 179



Stack Trace:





[HttpException (0x80004005): Request is not available in this context]

   System.Web.UI.Page.get_Request() +62

   SupplyNet.WEB.spNetProducts.FillDropDownLIST() in

c:\inetpub\wwwroot\supplynet\spnetproducts.cs:179

   SupplyNet.WEB.spNetProducts.Page_Load(Object sender, EventArgs e) in

c:\inetpub\wwwroot\supplynet\spnetproducts.cs:63

   System.Web.UI.Control.OnUnload(EventArgs e) +111

   System.Web.UI.Control.UnloadRecursive() +114

   System.Web.UI.Control.UnloadRecursive() +54

   System.Web.UI.Page.ProcessRequest() +405

   System.Web.UI.Page.ProcessRequest(HttpContext context) +19

   System.Web.HttpApplication$CallHandlerExecutionStep.Execute() +180

   System.Web.HttpApplication.ExecuteStep(HttpApplication$IExecutionStep

step,

Boolean& completedSynchronously) +176









----------------------------------------------------------------------------

----



Version Information: Runtime Build: 1.0.2204.21; ASP.NET Build:

1.0.2204.21





---

http://www.asptoday.com - the leading site for timely,

in-depth information for ASP developers everywhere.

---

You are currently subscribed to aspx as: $subst('Recip.EmailAddr')

To unsubscribe send a blank email to leave-aspx-$subst('Recip.MemberIDChar')@p2p.wrox.com

Message #2 by "Thomas Tomiczek" <t.tomiczek@t...> on Tue, 2 Jan 2001 11:29:03 +0100
Which - what you forgot to explicitly mention - is by design of the

cookie mechanism and shall prevent manipulation of cookies that you do

not own. So, this is NOT a limitation of the ASP/ASP.NET model, but

actually asecurity feature of cookies in general.



Thomas Tomiczek

THONA Consulting

http://www.thona-consulting.com/



-----Original Message-----

From: Fredrik Norm=E9n [mailto:fredrik.normen@e...]

Sent: Dienstag, 2. Januar 2001 10:06

To: ASP+

Subject: [aspx] RE: Application Error: Request is not available in this

context





example:



If you create a cookie in the directory myApp/test

you can't get the value from the same cookie in the directory

myApp/test2.

You can only get the value from the cookie in the sub directories to

myApp/test and in the myApp/test directory.



So if your ASP.NET page is not located in the sub directory or in the

same

driectory there the cookie was created, you will have problems to get

the

value from the cookie.



/Fredrik Norm=E9n







---

http://www.asptoday.com - the leading site for timely,

in-depth information for ASP developers everywhere.

---

You are currently subscribed to aspx as: $subst('Recip.EmailAddr')

To unsubscribe send a blank email to leave-aspx-$subst('Recip.MemberIDChar')@p2p.wrox.com


  Return to Index