473,397 Members | 1,949 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,397 software developers and data experts.

Can't access System.Web.HttpServerUtility in class

Joe
Hello All;

I can't access System.Web.HttpServerUtility from within a Class. I want to
have access to MapPath.

What I get are three options. They are:

AspNetHostingPermission
AspNetHostingPermissionAttributes
AspNetHostingPermissionLevel

What gives? What did I miss?

TIA,
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
Nov 19 '05 #1
17 3561
Try :

HttpContext.Current.Server.MapPath("filename.aspx" )


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:6A**********************************@microsof t.com...
Hello All;

I can't access System.Web.HttpServerUtility from within a Class. I want to
have access to MapPath.

What I get are three options. They are:

AspNetHostingPermission
AspNetHostingPermissionAttributes
AspNetHostingPermissionLevel

What gives? What did I miss?

TIA,
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation

Nov 19 '05 #2
You need an instance of that class to access the members. Nothing is
static.
"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:6A**********************************@microsof t.com...
Hello All;

I can't access System.Web.HttpServerUtility from within a Class. I want
to
have access to MapPath.

What I get are three options. They are:

AspNetHostingPermission
AspNetHostingPermissionAttributes
AspNetHostingPermissionLevel

What gives? What did I miss?

TIA,
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation

Nov 19 '05 #3
I guess in light of Juan's explaination, never mind.

"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
You need an instance of that class to access the members. Nothing is
static.
"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:6A**********************************@microsof t.com...
Hello All;

I can't access System.Web.HttpServerUtility from within a Class. I want
to
have access to MapPath.

What I get are three options. They are:

AspNetHostingPermission
AspNetHostingPermissionAttributes
AspNetHostingPermissionLevel

What gives? What did I miss?

TIA,
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation


Nov 19 '05 #4
Joe
No. They're not there. The only options are:

AspNetHostingPermission
AspNetHostingPermissionAttributes
AspNetHostingPermissionLevel

Do you know why?

--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Juan T. Llibre" wrote:
Try :

HttpContext.Current.Server.MapPath("filename.aspx" )


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:6A**********************************@microsof t.com...
Hello All;

I can't access System.Web.HttpServerUtility from within a Class. I want to
have access to MapPath.

What I get are three options. They are:

AspNetHostingPermission
AspNetHostingPermissionAttributes
AspNetHostingPermissionLevel

What gives? What did I miss?

TIA,
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation


Nov 19 '05 #5
What do you mean "They're not there", Joe ?

All you have to do, within any class file, is write

HttpContext.

and the available options *will* come up in Intellisense.

First, you choose HttpContext.Current and when you add another dot

HttpContext.Current.

You then select Server and get HttpContext.Current.Server
and then you add another dot :

HttpContext.Current.Server. and you select MapPath
which gives you HttpContext.Current.Server.MapPath

Then, all you need to do is add ("YourFileName.aspx")

If you don't do that, you won't see the correct options.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:B0**********************************@microsof t.com...
No. They're not there. The only options are:

AspNetHostingPermission
AspNetHostingPermissionAttributes
AspNetHostingPermissionLevel

Do you know why?
--
Joe "Juan T. Llibre" wrote:
Try :

HttpContext.Current.Server.MapPath("filename.aspx" )


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:6A**********************************@microsof t.com...
> Hello All;
>
> I can't access System.Web.HttpServerUtility from within a Class. I want to
> have access to MapPath.
>
> What I get are three options. They are:
>
> AspNetHostingPermission
> AspNetHostingPermissionAttributes
> AspNetHostingPermissionLevel
>
> What gives? What did I miss?
>
> TIA,
> --
> Joe
>
> VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation


Nov 19 '05 #6
Joe
Peter,

If I type Dim s as System.Web. what appears in the Intellisense are the
following options:

AspNetHostingPermission
AspNetHostingPermissionAttributes
AspNetHostingPermissionLevel

I can't even get to the HttpCoontext or HttpServerUtilities class.

Any ideas?
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Peter Rilling" wrote:
I guess in light of Juan's explaination, never mind.

"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
You need an instance of that class to access the members. Nothing is
static.
"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:6A**********************************@microsof t.com...
Hello All;

I can't access System.Web.HttpServerUtility from within a Class. I want
to
have access to MapPath.

What I get are three options. They are:

AspNetHostingPermission
AspNetHostingPermissionAttributes
AspNetHostingPermissionLevel

What gives? What did I miss?

TIA,
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation



Nov 19 '05 #7
Joe
Hi Juan,

I mean that they're not there.

If I type "System" fiollowed by a period, the intellisense shows the options
within System. I select Web. After Web, I type a period and the
intellisense shows the following three options:

AspNetHostingPermission
AspNetHostingPermissionAttributes
AspNetHostingPermissionLevel

--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Juan T. Llibre" wrote:
What do you mean "They're not there", Joe ?

All you have to do, within any class file, is write

HttpContext.

and the available options *will* come up in Intellisense.

First, you choose HttpContext.Current and when you add another dot

HttpContext.Current.

You then select Server and get HttpContext.Current.Server
and then you add another dot :

HttpContext.Current.Server. and you select MapPath
which gives you HttpContext.Current.Server.MapPath

Then, all you need to do is add ("YourFileName.aspx")

If you don't do that, you won't see the correct options.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:B0**********************************@microsof t.com...
No. They're not there. The only options are:

AspNetHostingPermission
AspNetHostingPermissionAttributes
AspNetHostingPermissionLevel

Do you know why?
--
Joe

"Juan T. Llibre" wrote:
Try :

HttpContext.Current.Server.MapPath("filename.aspx" )


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:6A**********************************@microsof t.com...
> Hello All;
>
> I can't access System.Web.HttpServerUtility from within a Class. I want to
> have access to MapPath.
>
> What I get are three options. They are:
>
> AspNetHostingPermission
> AspNetHostingPermissionAttributes
> AspNetHostingPermissionLevel
>
> What gives? What did I miss?
>
> TIA,
> --
> Joe
>
> VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation


Nov 19 '05 #8
You don't need to type System.

All you nee to type is HttpContext.

Notice the period after HttpContext.
You *must* include the period for Intellisense to kick in.

Then, select Current, and so on, as listed in my previous post.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:40**********************************@microsof t.com...
Hi Juan,

I mean that they're not there.

If I type "System" fiollowed by a period, the intellisense shows the options
within System. I select Web. After Web, I type a period and the
intellisense shows the following three options:

AspNetHostingPermission
AspNetHostingPermissionAttributes
AspNetHostingPermissionLevel

--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Juan T. Llibre" wrote:
What do you mean "They're not there", Joe ?

All you have to do, within any class file, is write

HttpContext.

and the available options *will* come up in Intellisense.

First, you choose HttpContext.Current and when you add another dot

HttpContext.Current.

You then select Server and get HttpContext.Current.Server
and then you add another dot :

HttpContext.Current.Server. and you select MapPath
which gives you HttpContext.Current.Server.MapPath

Then, all you need to do is add ("YourFileName.aspx")

If you don't do that, you won't see the correct options.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:B0**********************************@microsof t.com...
> No. They're not there. The only options are:
>
> AspNetHostingPermission
> AspNetHostingPermissionAttributes
> AspNetHostingPermissionLevel
>
> Do you know why?
> --
> Joe

> "Juan T. Llibre" wrote:
>
>> Try :
>>
>> HttpContext.Current.Server.MapPath("filename.aspx" )
>>
>>
>>
>>
>> Juan T. Llibre, ASP.NET MVP
>> ASP.NET FAQ : http://asp.net.do/faq/
>> Foros de ASP.NET en Español : http://asp.net.do/foros/
>> ======================================
>> "Joe" <jo******@donotspam.yahoo.com> wrote in message
>> news:6A**********************************@microsof t.com...
>> > Hello All;
>> >
>> > I can't access System.Web.HttpServerUtility from within a Class. I want to
>> > have access to MapPath.
>> >
>> > What I get are three options. They are:
>> >
>> > AspNetHostingPermission
>> > AspNetHostingPermissionAttributes
>> > AspNetHostingPermissionLevel
>> >
>> > What gives? What did I miss?
>> >
>> > TIA,
>> > --
>> > Joe
>> >
>> > VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
>>
>>
>>


Nov 19 '05 #9
Let me amend that answer.

You *can * type System...but it's not needed.

If you *do* type System. , then you'll need to select

Web.
HttpContext.
Current.
Server.
and
MapPath
before you write (" to write in the filename you want a physical path for.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
You don't need to type System.

All you nee to type is HttpContext.

Notice the period after HttpContext.
You *must* include the period for Intellisense to kick in.

Then, select Current, and so on, as listed in my previous post.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:40**********************************@microsof t.com...
Hi Juan,

I mean that they're not there.

If I type "System" fiollowed by a period, the intellisense shows the options
within System. I select Web. After Web, I type a period and the
intellisense shows the following three options:

AspNetHostingPermission
AspNetHostingPermissionAttributes
AspNetHostingPermissionLevel

--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation


"Juan T. Llibre" wrote:
What do you mean "They're not there", Joe ?

All you have to do, within any class file, is write

HttpContext.

and the available options *will* come up in Intellisense.

First, you choose HttpContext.Current and when you add another dot

HttpContext.Current.

You then select Server and get HttpContext.Current.Server
and then you add another dot :

HttpContext.Current.Server. and you select MapPath
which gives you HttpContext.Current.Server.MapPath

Then, all you need to do is add ("YourFileName.aspx")

If you don't do that, you won't see the correct options.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:B0**********************************@microsof t.com...
> No. They're not there. The only options are:
>
> AspNetHostingPermission
> AspNetHostingPermissionAttributes
> AspNetHostingPermissionLevel
>
> Do you know why?
> --
> Joe

> "Juan T. Llibre" wrote:
>
>> Try :
>>
>> HttpContext.Current.Server.MapPath("filename.aspx" )
>>
>>
>>
>>
>> Juan T. Llibre, ASP.NET MVP
>> ASP.NET FAQ : http://asp.net.do/faq/
>> Foros de ASP.NET en Español : http://asp.net.do/foros/
>> ======================================
>> "Joe" <jo******@donotspam.yahoo.com> wrote in message
>> news:6A**********************************@microsof t.com...
>> > Hello All;
>> >
>> > I can't access System.Web.HttpServerUtility from within a Class. I want to
>> > have access to MapPath.
>> >
>> > What I get are three options. They are:
>> >
>> > AspNetHostingPermission
>> > AspNetHostingPermissionAttributes
>> > AspNetHostingPermissionLevel
>> >
>> > What gives? What did I miss?
>> >
>> > TIA,
>> > --
>> > Joe
>> >
>> > VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
>>
>>
>>


Nov 19 '05 #10
Joe
Juan,

Thanks. I understadn all of this. Please remember that I said that I am
tryignt o do this ina class. I am not tryign to do this in a webpage
cpde-behind.

From within the class, HttpContext is not even recognized.
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Juan T. Llibre" wrote:
Let me amend that answer.

You *can * type System...but it's not needed.

If you *do* type System. , then you'll need to select

Web.
HttpContext.
Current.
Server.
and
MapPath
before you write (" to write in the filename you want a physical path for.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
You don't need to type System.

All you nee to type is HttpContext.

Notice the period after HttpContext.
You *must* include the period for Intellisense to kick in.

Then, select Current, and so on, as listed in my previous post.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:40**********************************@microsof t.com...
Hi Juan,

I mean that they're not there.

If I type "System" fiollowed by a period, the intellisense shows the options
within System. I select Web. After Web, I type a period and the
intellisense shows the following three options:

AspNetHostingPermission
AspNetHostingPermissionAttributes
AspNetHostingPermissionLevel

--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation


"Juan T. Llibre" wrote:

What do you mean "They're not there", Joe ?

All you have to do, within any class file, is write

HttpContext.

and the available options *will* come up in Intellisense.

First, you choose HttpContext.Current and when you add another dot

HttpContext.Current.

You then select Server and get HttpContext.Current.Server
and then you add another dot :

HttpContext.Current.Server. and you select MapPath
which gives you HttpContext.Current.Server.MapPath

Then, all you need to do is add ("YourFileName.aspx")

If you don't do that, you won't see the correct options.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:B0**********************************@microsof t.com...
> No. They're not there. The only options are:
>
> AspNetHostingPermission
> AspNetHostingPermissionAttributes
> AspNetHostingPermissionLevel
>
> Do you know why?
> --
> Joe

> "Juan T. Llibre" wrote:
>
>> Try :
>>
>> HttpContext.Current.Server.MapPath("filename.aspx" )
>>
>>
>>
>>
>> Juan T. Llibre, ASP.NET MVP
>> ASP.NET FAQ : http://asp.net.do/faq/
>> Foros de ASP.NET en Español : http://asp.net.do/foros/
>> ======================================
>> "Joe" <jo******@donotspam.yahoo.com> wrote in message
>> news:6A**********************************@microsof t.com...
>> > Hello All;
>> >
>> > I can't access System.Web.HttpServerUtility from within a Class. I want to
>> > have access to MapPath.
>> >
>> > What I get are three options. They are:
>> >
>> > AspNetHostingPermission
>> > AspNetHostingPermissionAttributes
>> > AspNetHostingPermissionLevel
>> >
>> > What gives? What did I miss?
>> >
>> > TIA,
>> > --
>> > Joe
>> >
>> > VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
>>
>>
>>



Nov 19 '05 #11
Joe
Juan,

I understand how intellisense works. We don't need to go over that.

I tried typing HttpContext with the period. Nothing happens.

Remember that I am not doing this is in a webpage code-behind. I'm doing it
in a class (myClass.vb, not myPage.aspx).

This may have everything to do with where I am trying to do this.
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Juan T. Llibre" wrote:
You don't need to type System.

All you nee to type is HttpContext.

Notice the period after HttpContext.
You *must* include the period for Intellisense to kick in.

Then, select Current, and so on, as listed in my previous post.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:40**********************************@microsof t.com...
Hi Juan,

I mean that they're not there.

If I type "System" fiollowed by a period, the intellisense shows the options
within System. I select Web. After Web, I type a period and the
intellisense shows the following three options:

AspNetHostingPermission
AspNetHostingPermissionAttributes
AspNetHostingPermissionLevel

--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation


"Juan T. Llibre" wrote:
What do you mean "They're not there", Joe ?

All you have to do, within any class file, is write

HttpContext.

and the available options *will* come up in Intellisense.

First, you choose HttpContext.Current and when you add another dot

HttpContext.Current.

You then select Server and get HttpContext.Current.Server
and then you add another dot :

HttpContext.Current.Server. and you select MapPath
which gives you HttpContext.Current.Server.MapPath

Then, all you need to do is add ("YourFileName.aspx")

If you don't do that, you won't see the correct options.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:B0**********************************@microsof t.com...
> No. They're not there. The only options are:
>
> AspNetHostingPermission
> AspNetHostingPermissionAttributes
> AspNetHostingPermissionLevel
>
> Do you know why?
> --
> Joe

> "Juan T. Llibre" wrote:
>
>> Try :
>>
>> HttpContext.Current.Server.MapPath("filename.aspx" )
>>
>>
>>
>>
>> Juan T. Llibre, ASP.NET MVP
>> ASP.NET FAQ : http://asp.net.do/faq/
>> Foros de ASP.NET en Español : http://asp.net.do/foros/
>> ======================================
>> "Joe" <jo******@donotspam.yahoo.com> wrote in message
>> news:6A**********************************@microsof t.com...
>> > Hello All;
>> >
>> > I can't access System.Web.HttpServerUtility from within a Class. I want to
>> > have access to MapPath.
>> >
>> > What I get are three options. They are:
>> >
>> > AspNetHostingPermission
>> > AspNetHostingPermissionAttributes
>> > AspNetHostingPermissionLevel
>> >
>> > What gives? What did I miss?
>> >
>> > TIA,
>> > --
>> > Joe
>> >
>> > VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
>>
>>
>>


Nov 19 '05 #12
Are you trying to use it from a different assembly from your main site? Is
so, you may need to add a reference to the System.Web.dll assembly.

"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:7C**********************************@microsof t.com...
Juan,

Thanks. I understadn all of this. Please remember that I said that I am
tryignt o do this ina class. I am not tryign to do this in a webpage
cpde-behind.

From within the class, HttpContext is not even recognized.
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Juan T. Llibre" wrote:
Let me amend that answer.

You *can * type System...but it's not needed.

If you *do* type System. , then you'll need to select

Web.
HttpContext.
Current.
Server.
and
MapPath
before you write (" to write in the filename you want a physical path
for.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
> You don't need to type System.
>
> All you nee to type is HttpContext.
>
> Notice the period after HttpContext.
> You *must* include the period for Intellisense to kick in.
>
> Then, select Current, and so on, as listed in my previous post.
>
>
>
> Juan T. Llibre, ASP.NET MVP
> ASP.NET FAQ : http://asp.net.do/faq/
> Foros de ASP.NET en Español : http://asp.net.do/foros/
> ======================================
> "Joe" <jo******@donotspam.yahoo.com> wrote in message
> news:40**********************************@microsof t.com...
>> Hi Juan,
>>
>> I mean that they're not there.
>>
>> If I type "System" fiollowed by a period, the intellisense shows the
>> options
>> within System. I select Web. After Web, I type a period and the
>> intellisense shows the following three options:
>>
>> AspNetHostingPermission
>> AspNetHostingPermissionAttributes
>> AspNetHostingPermissionLevel
>>
>> --
>> Joe
>>
>> VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
>
>
>> "Juan T. Llibre" wrote:
>>
>>> What do you mean "They're not there", Joe ?
>>>
>>> All you have to do, within any class file, is write
>>>
>>> HttpContext.
>>>
>>> and the available options *will* come up in Intellisense.
>>>
>>> First, you choose HttpContext.Current and when you add another dot
>>>
>>> HttpContext.Current.
>>>
>>> You then select Server and get HttpContext.Current.Server
>>> and then you add another dot :
>>>
>>> HttpContext.Current.Server. and you select MapPath
>>> which gives you HttpContext.Current.Server.MapPath
>>>
>>> Then, all you need to do is add ("YourFileName.aspx")
>>>
>>> If you don't do that, you won't see the correct options.
>>>
>>>
>>>
>>> Juan T. Llibre, ASP.NET MVP
>>> ASP.NET FAQ : http://asp.net.do/faq/
>>> Foros de ASP.NET en Español : http://asp.net.do/foros/
>>> ======================================
>>> "Joe" <jo******@donotspam.yahoo.com> wrote in message
>>> news:B0**********************************@microsof t.com...
>>> > No. They're not there. The only options are:
>>> >
>>> > AspNetHostingPermission
>>> > AspNetHostingPermissionAttributes
>>> > AspNetHostingPermissionLevel
>>> >
>>> > Do you know why?
>>> > --
>>> > Joe
>>>
>>> > "Juan T. Llibre" wrote:
>>> >
>>> >> Try :
>>> >>
>>> >> HttpContext.Current.Server.MapPath("filename.aspx" )
>>> >>
>>> >>
>>> >>
>>> >>
>>> >> Juan T. Llibre, ASP.NET MVP
>>> >> ASP.NET FAQ : http://asp.net.do/faq/
>>> >> Foros de ASP.NET en Español : http://asp.net.do/foros/
>>> >> ======================================
>>> >> "Joe" <jo******@donotspam.yahoo.com> wrote in message
>>> >> news:6A**********************************@microsof t.com...
>>> >> > Hello All;
>>> >> >
>>> >> > I can't access System.Web.HttpServerUtility from within a Class.
>>> >> > I want to
>>> >> > have access to MapPath.
>>> >> >
>>> >> > What I get are three options. They are:
>>> >> >
>>> >> > AspNetHostingPermission
>>> >> > AspNetHostingPermissionAttributes
>>> >> > AspNetHostingPermissionLevel
>>> >> >
>>> >> > What gives? What did I miss?
>>> >> >
>>> >> > TIA,
>>> >> > --
>>> >> > Joe
>>> >> >
>>> >> > VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA
>>> >> > Automation
>>> >>
>>> >>
>>> >>
>>>
>>>
>>>
>
>


Nov 19 '05 #13
re:
Remember that I am not doing this is in a webpage code-behind.
I'm doing it in a class (myClass.vb, not myPage.aspx).
I understand what you're saying, but it doesn't reflect what I experience.
I tested that in a class file, not in a code-behind aspx page.

re: This may have everything to do with where I am trying to do this.
No, it does not.

Maybe you have a damaged VS ?
What version of VS are you using ?


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:00**********************************@microsof t.com... Juan,

I understand how intellisense works. We don't need to go over that.

I tried typing HttpContext with the period. Nothing happens.

Remember that I am not doing this is in a webpage code-behind. I'm doing it
in a class (myClass.vb, not myPage.aspx).

This may have everything to do with where I am trying to do this.
--
Joe VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Juan T. Llibre" wrote:
You don't need to type System.

All you nee to type is HttpContext.

Notice the period after HttpContext.
You *must* include the period for Intellisense to kick in.

Then, select Current, and so on, as listed in my previous post.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:40**********************************@microsof t.com...
> Hi Juan,
>
> I mean that they're not there.
>
> If I type "System" fiollowed by a period, the intellisense shows the options
> within System. I select Web. After Web, I type a period and the
> intellisense shows the following three options:
>
> AspNetHostingPermission
> AspNetHostingPermissionAttributes
> AspNetHostingPermissionLevel
>
> --
> Joe
>
> VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation


> "Juan T. Llibre" wrote:
>
>> What do you mean "They're not there", Joe ?
>>
>> All you have to do, within any class file, is write
>>
>> HttpContext.
>>
>> and the available options *will* come up in Intellisense.
>>
>> First, you choose HttpContext.Current and when you add another dot
>>
>> HttpContext.Current.
>>
>> You then select Server and get HttpContext.Current.Server
>> and then you add another dot :
>>
>> HttpContext.Current.Server. and you select MapPath
>> which gives you HttpContext.Current.Server.MapPath
>>
>> Then, all you need to do is add ("YourFileName.aspx")
>>
>> If you don't do that, you won't see the correct options.
>>
>>
>>
>> Juan T. Llibre, ASP.NET MVP
>> ASP.NET FAQ : http://asp.net.do/faq/
>> Foros de ASP.NET en Español : http://asp.net.do/foros/
>> ======================================
>> "Joe" <jo******@donotspam.yahoo.com> wrote in message
>> news:B0**********************************@microsof t.com...
>> > No. They're not there. The only options are:
>> >
>> > AspNetHostingPermission
>> > AspNetHostingPermissionAttributes
>> > AspNetHostingPermissionLevel
>> >
>> > Do you know why?
>> > --
>> > Joe
>>
>> > "Juan T. Llibre" wrote:
>> >
>> >> Try :
>> >>
>> >> HttpContext.Current.Server.MapPath("filename.aspx" )
>> >>
>> >>
>> >>
>> >>
>> >> Juan T. Llibre, ASP.NET MVP
>> >> ASP.NET FAQ : http://asp.net.do/faq/
>> >> Foros de ASP.NET en Español : http://asp.net.do/foros/
>> >> ======================================
>> >> "Joe" <jo******@donotspam.yahoo.com> wrote in message
>> >> news:6A**********************************@microsof t.com...
>> >> > Hello All;
>> >> >
>> >> > I can't access System.Web.HttpServerUtility from within a Class. I want to
>> >> > have access to MapPath.
>> >> >
>> >> > What I get are three options. They are:
>> >> >
>> >> > AspNetHostingPermission
>> >> > AspNetHostingPermissionAttributes
>> >> > AspNetHostingPermissionLevel
>> >> >
>> >> > What gives? What did I miss?

Nov 19 '05 #14
Joe
Peter,

That's it! When I look in the references, I don't see System.Web; I see
System. I added System.Web and I'm on my way.

Thank youa nd thank you to Juan!.

Would you please help me to understand this? What I taek from this is that
having a reference to System is not adequate because the functionality that I
want is actually located in a different assembly. Is this correct? Did I
express it correctly?

Thanks again.
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Peter Rilling" wrote:
Are you trying to use it from a different assembly from your main site? Is
so, you may need to add a reference to the System.Web.dll assembly.

"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:7C**********************************@microsof t.com...
Juan,

Thanks. I understadn all of this. Please remember that I said that I am
tryignt o do this ina class. I am not tryign to do this in a webpage
cpde-behind.

From within the class, HttpContext is not even recognized.
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Juan T. Llibre" wrote:
Let me amend that answer.

You *can * type System...but it's not needed.

If you *do* type System. , then you'll need to select

Web.
HttpContext.
Current.
Server.
and
MapPath
before you write (" to write in the filename you want a physical path
for.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
> You don't need to type System.
>
> All you nee to type is HttpContext.
>
> Notice the period after HttpContext.
> You *must* include the period for Intellisense to kick in.
>
> Then, select Current, and so on, as listed in my previous post.
>
>
>
> Juan T. Llibre, ASP.NET MVP
> ASP.NET FAQ : http://asp.net.do/faq/
> Foros de ASP.NET en Español : http://asp.net.do/foros/
> ======================================
> "Joe" <jo******@donotspam.yahoo.com> wrote in message
> news:40**********************************@microsof t.com...
>> Hi Juan,
>>
>> I mean that they're not there.
>>
>> If I type "System" fiollowed by a period, the intellisense shows the
>> options
>> within System. I select Web. After Web, I type a period and the
>> intellisense shows the following three options:
>>
>> AspNetHostingPermission
>> AspNetHostingPermissionAttributes
>> AspNetHostingPermissionLevel
>>
>> --
>> Joe
>>
>> VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
>
>
>> "Juan T. Llibre" wrote:
>>
>>> What do you mean "They're not there", Joe ?
>>>
>>> All you have to do, within any class file, is write
>>>
>>> HttpContext.
>>>
>>> and the available options *will* come up in Intellisense.
>>>
>>> First, you choose HttpContext.Current and when you add another dot
>>>
>>> HttpContext.Current.
>>>
>>> You then select Server and get HttpContext.Current.Server
>>> and then you add another dot :
>>>
>>> HttpContext.Current.Server. and you select MapPath
>>> which gives you HttpContext.Current.Server.MapPath
>>>
>>> Then, all you need to do is add ("YourFileName.aspx")
>>>
>>> If you don't do that, you won't see the correct options.
>>>
>>>
>>>
>>> Juan T. Llibre, ASP.NET MVP
>>> ASP.NET FAQ : http://asp.net.do/faq/
>>> Foros de ASP.NET en Español : http://asp.net.do/foros/
>>> ======================================
>>> "Joe" <jo******@donotspam.yahoo.com> wrote in message
>>> news:B0**********************************@microsof t.com...
>>> > No. They're not there. The only options are:
>>> >
>>> > AspNetHostingPermission
>>> > AspNetHostingPermissionAttributes
>>> > AspNetHostingPermissionLevel
>>> >
>>> > Do you know why?
>>> > --
>>> > Joe
>>>
>>> > "Juan T. Llibre" wrote:
>>> >
>>> >> Try :
>>> >>
>>> >> HttpContext.Current.Server.MapPath("filename.aspx" )
>>> >>
>>> >>
>>> >>
>>> >>
>>> >> Juan T. Llibre, ASP.NET MVP
>>> >> ASP.NET FAQ : http://asp.net.do/faq/
>>> >> Foros de ASP.NET en Español : http://asp.net.do/foros/
>>> >> ======================================
>>> >> "Joe" <jo******@donotspam.yahoo.com> wrote in message
>>> >> news:6A**********************************@microsof t.com...
>>> >> > Hello All;
>>> >> >
>>> >> > I can't access System.Web.HttpServerUtility from within a Class.
>>> >> > I want to
>>> >> > have access to MapPath.
>>> >> >
>>> >> > What I get are three options. They are:
>>> >> >
>>> >> > AspNetHostingPermission
>>> >> > AspNetHostingPermissionAttributes
>>> >> > AspNetHostingPermissionLevel
>>> >> >
>>> >> > What gives? What did I miss?
>>> >> >
>>> >> > TIA,
>>> >> > --
>>> >> > Joe
>>> >> >
>>> >> > VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA
>>> >> > Automation
>>> >>
>>> >>
>>> >>
>>>
>>>
>>>
>
>


Nov 19 '05 #15
Joe
Juan,

Please see my reply to Peter. Thank you for your help. I appreciate your
efforts.

The problem was that I didn't have a refernece set to the System.Web assembly.
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Juan T. Llibre" wrote:
re:
Remember that I am not doing this is in a webpage code-behind.
I'm doing it in a class (myClass.vb, not myPage.aspx).


I understand what you're saying, but it doesn't reflect what I experience.
I tested that in a class file, not in a code-behind aspx page.

re:
This may have everything to do with where I am trying to do this.


No, it does not.

Maybe you have a damaged VS ?
What version of VS are you using ?


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:00**********************************@microsof t.com...
Juan,

I understand how intellisense works. We don't need to go over that.

I tried typing HttpContext with the period. Nothing happens.

Remember that I am not doing this is in a webpage code-behind. I'm doing it
in a class (myClass.vb, not myPage.aspx).

This may have everything to do with where I am trying to do this.
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Juan T. Llibre" wrote:
You don't need to type System.

All you nee to type is HttpContext.

Notice the period after HttpContext.
You *must* include the period for Intellisense to kick in.

Then, select Current, and so on, as listed in my previous post.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:40**********************************@microsof t.com...
> Hi Juan,
>
> I mean that they're not there.
>
> If I type "System" fiollowed by a period, the intellisense shows the options
> within System. I select Web. After Web, I type a period and the
> intellisense shows the following three options:
>
> AspNetHostingPermission
> AspNetHostingPermissionAttributes
> AspNetHostingPermissionLevel
>
> --
> Joe
>
> VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
> "Juan T. Llibre" wrote:
>
>> What do you mean "They're not there", Joe ?
>>
>> All you have to do, within any class file, is write
>>
>> HttpContext.
>>
>> and the available options *will* come up in Intellisense.
>>
>> First, you choose HttpContext.Current and when you add another dot
>>
>> HttpContext.Current.
>>
>> You then select Server and get HttpContext.Current.Server
>> and then you add another dot :
>>
>> HttpContext.Current.Server. and you select MapPath
>> which gives you HttpContext.Current.Server.MapPath
>>
>> Then, all you need to do is add ("YourFileName.aspx")
>>
>> If you don't do that, you won't see the correct options.
>>
>>
>>
>> Juan T. Llibre, ASP.NET MVP
>> ASP.NET FAQ : http://asp.net.do/faq/
>> Foros de ASP.NET en Español : http://asp.net.do/foros/
>> ======================================
>> "Joe" <jo******@donotspam.yahoo.com> wrote in message
>> news:B0**********************************@microsof t.com...
>> > No. They're not there. The only options are:
>> >
>> > AspNetHostingPermission
>> > AspNetHostingPermissionAttributes
>> > AspNetHostingPermissionLevel
>> >
>> > Do you know why?
>> > --
>> > Joe
>>
>> > "Juan T. Llibre" wrote:
>> >
>> >> Try :
>> >>
>> >> HttpContext.Current.Server.MapPath("filename.aspx" )
>> >>
>> >>
>> >>
>> >>
>> >> Juan T. Llibre, ASP.NET MVP
>> >> ASP.NET FAQ : http://asp.net.do/faq/
>> >> Foros de ASP.NET en Español : http://asp.net.do/foros/
>> >> ======================================
>> >> "Joe" <jo******@donotspam.yahoo.com> wrote in message
>> >> news:6A**********************************@microsof t.com...
>> >> > Hello All;
>> >> >
>> >> > I can't access System.Web.HttpServerUtility from within a Class. I want to
>> >> > have access to MapPath.
>> >> >
>> >> > What I get are three options. They are:
>> >> >
>> >> > AspNetHostingPermission
>> >> > AspNetHostingPermissionAttributes
>> >> > AspNetHostingPermissionLevel
>> >> >
>> >> > What gives? What did I miss?


Nov 19 '05 #16
Hi, Joe.

Glad to see that Peter hit the nail on its head.

System and System.Web are two different assemblies.

See the System assembly :

http://beta.asp.net/QUICKSTART/util/...mespace=System

Now, see the System.Web assembly :
http://beta.asp.net/QUICKSTART/util/...ace=System.Web

Two totally different assemblies...

Also, if you look in your .Net Framework directory :
drive:\WINDOWS\Microsoft.NET\Framework\vx.x.xxxxx
you'll see that there's different dll's for them : system.dll and system.web.dll

Glad to see that you're on the good track again.

;-)


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:D8**********************************@microsof t.com...
Peter,

That's it! When I look in the references, I don't see System.Web; I see
System. I added System.Web and I'm on my way.

Thank youa nd thank you to Juan!.

Would you please help me to understand this? What I taek from this is that
having a reference to System is not adequate because the functionality that I
want is actually located in a different assembly. Is this correct? Did I
express it correctly?

Thanks again.
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Peter Rilling" wrote:
Are you trying to use it from a different assembly from your main site? Is
so, you may need to add a reference to the System.Web.dll assembly.

"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:7C**********************************@microsof t.com...
> Juan,
>
> Thanks. I understadn all of this. Please remember that I said that I am
> tryignt o do this ina class. I am not tryign to do this in a webpage
> cpde-behind.
>
> From within the class, HttpContext is not even recognized.
> --
> Joe
>
> VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
>
>
> "Juan T. Llibre" wrote:
>
>> Let me amend that answer.
>>
>> You *can * type System...but it's not needed.
>>
>> If you *do* type System. , then you'll need to select
>>
>> Web.
>> HttpContext.
>> Current.
>> Server.
>> and
>> MapPath
>> before you write (" to write in the filename you want a physical path
>> for.
>>
>>
>>
>> Juan T. Llibre, ASP.NET MVP
>> ASP.NET FAQ : http://asp.net.do/faq/
>> Foros de ASP.NET en Español : http://asp.net.do/foros/
>> ======================================
>>
>> "Juan T. Llibre" <no***********@nowhere.com> wrote in message
>> news:%2****************@TK2MSFTNGP09.phx.gbl...
>> > You don't need to type System.
>> >
>> > All you nee to type is HttpContext.
>> >
>> > Notice the period after HttpContext.
>> > You *must* include the period for Intellisense to kick in.
>> >
>> > Then, select Current, and so on, as listed in my previous post.
>> >
>> >
>> >
>> > Juan T. Llibre, ASP.NET MVP
>> > ASP.NET FAQ : http://asp.net.do/faq/
>> > Foros de ASP.NET en Español : http://asp.net.do/foros/
>> > ======================================
>> > "Joe" <jo******@donotspam.yahoo.com> wrote in message
>> > news:40**********************************@microsof t.com...
>> >> Hi Juan,
>> >>
>> >> I mean that they're not there.
>> >>
>> >> If I type "System" fiollowed by a period, the intellisense shows the
>> >> options
>> >> within System. I select Web. After Web, I type a period and the
>> >> intellisense shows the following three options:
>> >>
>> >> AspNetHostingPermission
>> >> AspNetHostingPermissionAttributes
>> >> AspNetHostingPermissionLevel
>> >>
>> >> --
>> >> Joe
>> >>
>> >> VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
>> >
>> >
>> >> "Juan T. Llibre" wrote:
>> >>
>> >>> What do you mean "They're not there", Joe ?
>> >>>
>> >>> All you have to do, within any class file, is write
>> >>>
>> >>> HttpContext.
>> >>>
>> >>> and the available options *will* come up in Intellisense.
>> >>>
>> >>> First, you choose HttpContext.Current and when you add another dot
>> >>>
>> >>> HttpContext.Current.
>> >>>
>> >>> You then select Server and get HttpContext.Current.Server
>> >>> and then you add another dot :
>> >>>
>> >>> HttpContext.Current.Server. and you select MapPath
>> >>> which gives you HttpContext.Current.Server.MapPath
>> >>>
>> >>> Then, all you need to do is add ("YourFileName.aspx")
>> >>>
>> >>> If you don't do that, you won't see the correct options.
>> >>>
>> >>>
>> >>>
>> >>> Juan T. Llibre, ASP.NET MVP
>> >>> ASP.NET FAQ : http://asp.net.do/faq/
>> >>> Foros de ASP.NET en Español : http://asp.net.do/foros/
>> >>> ======================================
>> >>> "Joe" <jo******@donotspam.yahoo.com> wrote in message
>> >>> news:B0**********************************@microsof t.com...
>> >>> > No. They're not there. The only options are:
>> >>> >
>> >>> > AspNetHostingPermission
>> >>> > AspNetHostingPermissionAttributes
>> >>> > AspNetHostingPermissionLevel
>> >>> >
>> >>> > Do you know why?
>> >>> > --
>> >>> > Joe
>> >>>
>> >>> > "Juan T. Llibre" wrote:
>> >>> >
>> >>> >> Try :
>> >>> >>
>> >>> >> HttpContext.Current.Server.MapPath("filename.aspx" )
>> >>> >>
>> >>> >>
>> >>> >>
>> >>> >>
>> >>> >> Juan T. Llibre, ASP.NET MVP
>> >>> >> ASP.NET FAQ : http://asp.net.do/faq/
>> >>> >> Foros de ASP.NET en Español : http://asp.net.do/foros/
>> >>> >> ======================================
>> >>> >> "Joe" <jo******@donotspam.yahoo.com> wrote in message
>> >>> >> news:6A**********************************@microsof t.com...
>> >>> >> > Hello All;
>> >>> >> >
>> >>> >> > I can't access System.Web.HttpServerUtility from within a Class.
>> >>> >> > I want to
>> >>> >> > have access to MapPath.
>> >>> >> >
>> >>> >> > What I get are three options. They are:
>> >>> >> >
>> >>> >> > AspNetHostingPermission
>> >>> >> > AspNetHostingPermissionAttributes
>> >>> >> > AspNetHostingPermissionLevel
>> >>> >> >
>> >>> >> > What gives? What did I miss?
>> >>> >> >
>> >>> >> > TIA,
>> >>> >> > --
>> >>> >> > Joe
>> >>> >> >
>> >>> >> > VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA
>> >>> >> > Automation
>> >>> >>
>> >>> >>
>> >>> >>
>> >>>
>> >>>
>> >>>
>> >
>> >
>>
>>
>>


Nov 19 '05 #17
Joe
Thanks.

I appreciate all of your help.
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Juan T. Llibre" wrote:
Hi, Joe.

Glad to see that Peter hit the nail on its head.

System and System.Web are two different assemblies.

See the System assembly :

http://beta.asp.net/QUICKSTART/util/...mespace=System

Now, see the System.Web assembly :
http://beta.asp.net/QUICKSTART/util/...ace=System.Web

Two totally different assemblies...

Also, if you look in your .Net Framework directory :
drive:\WINDOWS\Microsoft.NET\Framework\vx.x.xxxxx
you'll see that there's different dll's for them : system.dll and system.web.dll

Glad to see that you're on the good track again.

;-)


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:D8**********************************@microsof t.com...
Peter,

That's it! When I look in the references, I don't see System.Web; I see
System. I added System.Web and I'm on my way.

Thank youa nd thank you to Juan!.

Would you please help me to understand this? What I taek from this is that
having a reference to System is not adequate because the functionality that I
want is actually located in a different assembly. Is this correct? Did I
express it correctly?

Thanks again.
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Peter Rilling" wrote:
Are you trying to use it from a different assembly from your main site? Is
so, you may need to add a reference to the System.Web.dll assembly.

"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:7C**********************************@microsof t.com...
> Juan,
>
> Thanks. I understadn all of this. Please remember that I said that I am
> tryignt o do this ina class. I am not tryign to do this in a webpage
> cpde-behind.
>
> From within the class, HttpContext is not even recognized.
> --
> Joe
>
> VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
>
>
> "Juan T. Llibre" wrote:
>
>> Let me amend that answer.
>>
>> You *can * type System...but it's not needed.
>>
>> If you *do* type System. , then you'll need to select
>>
>> Web.
>> HttpContext.
>> Current.
>> Server.
>> and
>> MapPath
>> before you write (" to write in the filename you want a physical path
>> for.
>>
>>
>>
>> Juan T. Llibre, ASP.NET MVP
>> ASP.NET FAQ : http://asp.net.do/faq/
>> Foros de ASP.NET en Español : http://asp.net.do/foros/
>> ======================================
>>
>> "Juan T. Llibre" <no***********@nowhere.com> wrote in message
>> news:%2****************@TK2MSFTNGP09.phx.gbl...
>> > You don't need to type System.
>> >
>> > All you nee to type is HttpContext.
>> >
>> > Notice the period after HttpContext.
>> > You *must* include the period for Intellisense to kick in.
>> >
>> > Then, select Current, and so on, as listed in my previous post.
>> >
>> >
>> >
>> > Juan T. Llibre, ASP.NET MVP
>> > ASP.NET FAQ : http://asp.net.do/faq/
>> > Foros de ASP.NET en Español : http://asp.net.do/foros/
>> > ======================================
>> > "Joe" <jo******@donotspam.yahoo.com> wrote in message
>> > news:40**********************************@microsof t.com...
>> >> Hi Juan,
>> >>
>> >> I mean that they're not there.
>> >>
>> >> If I type "System" fiollowed by a period, the intellisense shows the
>> >> options
>> >> within System. I select Web. After Web, I type a period and the
>> >> intellisense shows the following three options:
>> >>
>> >> AspNetHostingPermission
>> >> AspNetHostingPermissionAttributes
>> >> AspNetHostingPermissionLevel
>> >>
>> >> --
>> >> Joe
>> >>
>> >> VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
>> >
>> >
>> >> "Juan T. Llibre" wrote:
>> >>
>> >>> What do you mean "They're not there", Joe ?
>> >>>
>> >>> All you have to do, within any class file, is write
>> >>>
>> >>> HttpContext.
>> >>>
>> >>> and the available options *will* come up in Intellisense.
>> >>>
>> >>> First, you choose HttpContext.Current and when you add another dot
>> >>>
>> >>> HttpContext.Current.
>> >>>
>> >>> You then select Server and get HttpContext.Current.Server
>> >>> and then you add another dot :
>> >>>
>> >>> HttpContext.Current.Server. and you select MapPath
>> >>> which gives you HttpContext.Current.Server.MapPath
>> >>>
>> >>> Then, all you need to do is add ("YourFileName.aspx")
>> >>>
>> >>> If you don't do that, you won't see the correct options.
>> >>>
>> >>>
>> >>>
>> >>> Juan T. Llibre, ASP.NET MVP
>> >>> ASP.NET FAQ : http://asp.net.do/faq/
>> >>> Foros de ASP.NET en Español : http://asp.net.do/foros/
>> >>> ======================================
>> >>> "Joe" <jo******@donotspam.yahoo.com> wrote in message
>> >>> news:B0**********************************@microsof t.com...
>> >>> > No. They're not there. The only options are:
>> >>> >
>> >>> > AspNetHostingPermission
>> >>> > AspNetHostingPermissionAttributes
>> >>> > AspNetHostingPermissionLevel
>> >>> >
>> >>> > Do you know why?
>> >>> > --
>> >>> > Joe
>> >>>
>> >>> > "Juan T. Llibre" wrote:
>> >>> >
>> >>> >> Try :
>> >>> >>
>> >>> >> HttpContext.Current.Server.MapPath("filename.aspx" )
>> >>> >>
>> >>> >>
>> >>> >>
>> >>> >>
>> >>> >> Juan T. Llibre, ASP.NET MVP
>> >>> >> ASP.NET FAQ : http://asp.net.do/faq/
>> >>> >> Foros de ASP.NET en Español : http://asp.net.do/foros/
>> >>> >> ======================================
>> >>> >> "Joe" <jo******@donotspam.yahoo.com> wrote in message
>> >>> >> news:6A**********************************@microsof t.com...
>> >>> >> > Hello All;
>> >>> >> >
>> >>> >> > I can't access System.Web.HttpServerUtility from within a Class.
>> >>> >> > I want to
>> >>> >> > have access to MapPath.
>> >>> >> >
>> >>> >> > What I get are three options. They are:
>> >>> >> >
>> >>> >> > AspNetHostingPermission
>> >>> >> > AspNetHostingPermissionAttributes
>> >>> >> > AspNetHostingPermissionLevel
>> >>> >> >
>> >>> >> > What gives? What did I miss?
>> >>> >> >
>> >>> >> > TIA,
>> >>> >> > --
>> >>> >> > Joe
>> >>> >> >
>> >>> >> > VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA
>> >>> >> > Automation
>> >>> >>
>> >>> >>
>> >>> >>
>> >>>
>> >>>
>> >>>
>> >
>> >
>>
>>
>>


Nov 19 '05 #18

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

Similar topics

1
by: uv2003 | last post by:
Greetings, I've read through some other posts and looked at this class through reflector. All of its contructors are internal, so it cannot be instantiated outside of ASP.NET. This seems...
3
by: Sushil Srivastava | last post by:
Hi Guys, Would you be able to help me using C# GUI (with user interface component) in my MFC application. I have used managed extension, COM-interops, etc but problem is this C# component has...
29
by: Patrick | last post by:
I have the following code, which regardless which works fine and logs to the EventViewer regardless of whether <processModel/> section of machine.config is set to username="SYSTEM" or "machine" ...
10
by: bradtm | last post by:
So I have this hierarchy: + Solution | |--- + Class Library Project | | | |--- LogError.vb | |--- + ASP .NET Web Application |
4
by: Plop Plop via DotNetMonster.com | last post by:
Hello, i'm a newbie at asp.net, and i'm developping a site at the moment, and want to add a sort off logging system. I would like to create a file on the server side when a error occured. Now...
3
by: Rachel | last post by:
Hi, I am using the data access application block successfully in our development environment, however when I deploy to our testing server as Private Assemblies I keep getting the following ...
1
by: Mike Hofer | last post by:
I really need some help, and I'd appreciate any that you folks can provide. The ASP.NET application in question uses version 1.1 of the .NET Framework. All of the pages use a common base class...
4
by: mark4asp | last post by:
What is the best way to locate the namespace I need to put in a using statement? For example suppose I wanted to discover which namespace "Server" was in the context of: Exception ex =...
6
by: =?Utf-8?B?SmF5IFBvbmR5?= | last post by:
I am trying to access a Public property on a Master Page from a Base Page. On the content pages I have the MasterType Directive set up as follows: <%@ MasterType virtualpath="~/Master.master" %>...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.