471,316 Members | 1,026 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,316 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 3453
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Sushil Srivastava | last post: by
29 posts views Thread by Patrick | last post: by
4 posts views Thread by Plop Plop via DotNetMonster.com | last post: by
3 posts views Thread by Rachel | last post: by
6 posts views Thread by =?Utf-8?B?SmF5IFBvbmR5?= | last post: by
reply views Thread by rosydwin | last post: by

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.