having some issues when I try to use it from a vb class in my application.
Looking in help, it looks like I need to do something like this:
dim Server As HttpServerUtility
Dim path As String = Server.MapPath("myfile.txt")
--
But any time I use that Server variable I get a null refrence exception.
What am I doing wrong? Thanks!
MattYou have to use httpcontext to get the server object when you are on a
class. Hope this helps
snt
http://www.flexoweb.com
Don't write "dim Server As HttpServerUtility"
just
Dim path As String = Server.MapPath("myfile.txt")
Ibrahim ULUDAG
www.ibrahimuludag.com
"MattB" <somedudeus@.yahoo.com> wrote in message
news:3gu0paFedcjhU1@.individual.net...
> I've used this a bit from codebehind with no problems, but now I'm having
> some issues when I try to use it from a vb class in my application.
> Looking in help, it looks like I need to do something like this:
> dim Server As HttpServerUtility
> Dim path As String = Server.MapPath("myfile.txt")
> --
> But any time I use that Server variable I get a null refrence exception.
> What am I doing wrong? Thanks!
> Matt
tint wrote:
> You have to use httpcontext to get the server object when you are on a
> class. Hope this helps
> snt
> http://www.flexoweb.com
Yep. HttpContext.Current to be exact. Thanks!
Matt
Great, I had the same problem, HttpContext.Current.Server.MapPath works
perfect!
--
kris kilowatt
----------------------
Posted via http://www.codecomments.com
----------------------
0 comments:
Post a Comment