473,231 Members | 1,358 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,231 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 3555
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: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.