473,403 Members | 2,270 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Errors on ..ServerVariables

Why is
System.Web.HttpContext.Current.Request.ServerVaria bles["APPL_PHYSICAL_PATH"]
giving me the following message:

C:\VSProjects\NewHires\NewHire.cs(227):
'System.Web.HttpRequest.ServerVariables' denotes a 'property' where a
'method' was expected

I have used this is in other projects without any problems.

Here is my using section - am I missing anything there?

using System;
using System.Data;
using System.IO;
using ICSharpCode.SharpZipLib.Zip;
using ICSharpCode.SharpZipLib.Checksums;
using System.Text.RegularExpressions;
using System.Data.SqlClient;
using System.Web.Services;
using MyFunctions;
using System.Collections;
using System.ComponentModel;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

Thanks,

Tom
Mar 23 '07 #1
2 1876
On Mar 23, 8:51 pm, "tshad" <t...@home.comwrote:
Why is
System.Web.HttpContext.Current.Request.ServerVaria bles["APPL_PHYSICAL_PATH"*]
giving me the following message:

C:\VSProjects\NewHires\NewHire.cs(227):
'System.Web.HttpRequest.ServerVariables' denotes a 'property' where a
'method' was expected
Maybe you forgot a parentheses after .ToString()? Usually this error
is about ( ) [ ]

System.Web.HttpContext.Current.Request.ServerVaria bles["APPL_PHYSICAL_PATH"*].ToString()
Mar 23 '07 #2
many of these items have their own properties on the Request object, that are
a lot easier to access that way, e.g.

HttpContext.Current.Request.PhysicalApplicationPat h ;

--Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"tshad" wrote:
Why is
System.Web.HttpContext.Current.Request.ServerVaria bles["APPL_PHYSICAL_PATH"]
giving me the following message:

C:\VSProjects\NewHires\NewHire.cs(227):
'System.Web.HttpRequest.ServerVariables' denotes a 'property' where a
'method' was expected

I have used this is in other projects without any problems.

Here is my using section - am I missing anything there?

using System;
using System.Data;
using System.IO;
using ICSharpCode.SharpZipLib.Zip;
using ICSharpCode.SharpZipLib.Checksums;
using System.Text.RegularExpressions;
using System.Data.SqlClient;
using System.Web.Services;
using MyFunctions;
using System.Collections;
using System.ComponentModel;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

Thanks,

Tom
Mar 23 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: W. Loo | last post by:
Hi, I've got a question regarding the usage of Request.ServerVariables. I'm not sure this is really a ASP question, so redirects to a more appropriate newsgroup are welcome. I have a variable...
3
by: Bruno G. | last post by:
Hello! Is it possible for IIS to send some sort of notification when an ASP error occurs on a page? I can see them in the web logs, but I was wondering if there was a way to receive an email...
3
by: crjunk | last post by:
I have the following url: https://test.mywebsite.com/secure/programs/test.asp?TOPIC_ID=21 How can I get the value "secure/programs/test.asp?TOPIC_ID=21" I can't use...
4
by: Martin | last post by:
Hi, From Page1.asp, I use "Server.transfer" to "REDIRECT" to another asp page (page2.asp), in page2.asp I use Request.ServerVariables("URL") and Request.ServerVariables("REFERER") to get the...
0
by: Dave | last post by:
Hi, I'm trying to make a WebRequest to url using the code below. The url points to a large number XML files on my shared dev server via a virtual folder secured using basic authentication. I did...
2
by: TS | last post by:
I seem to remember reading somewhere that accessing this collection is expensive and you should avoid it if possible. Are there any alternatives to the following: Request.ServerVariables; ...
2
by: darrel | last post by:
I have a question below about an error I am getting: Exception has been thrown by the target of an invocation. Is there anyway to get asp.net to give me more details than the above? My catch...
1
by: preet | last post by:
I posted this elsewhere ; probably the wrong place so i am posting this again I am using the following script: hrefer=Request.Servervariables("HTTP_REFERER")...
1
by: Ryan | last post by:
I am trying to figure out why I am trying to use the result of Request.ServerVariables("LOGON_USER") in a query in my aspx application. I want to use the server variable. When I check the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.