Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 20th, 2005, 02:29 PM
Authorized User
 
Join Date: Jul 2005
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default Request Object

I am writing a class that manipulates the request object.
But how to get the request object when invoking this method?

I have a function

public static string getSomething(object sender){
 return ((Request)object).ServerVariables["SCRIPT_NAME"];
}

The above method won't work when invoking from an object of Page.

Any clue?

 
Old October 21st, 2005, 02:01 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

you need to use HTTPContext:

HttpContext.Current.Request.ServerVariables [" .. "];






Similar Threads
Thread Thread Starter Forum Replies Last Post
object required Request RoniR ASP.NET 1.0 and 1.1 Basics 3 January 8th, 2007 06:53 AM
Request Object kagitas .NET Web Services 1 October 2nd, 2004 10:26 PM
the request object Toran Classic ASP Basics 0 June 27th, 2003 01:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.