|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
problem with relative paths in VS/VB.neti almost feel stupid asking about this topic, but since i'm new to vb.net what the hell.... i'm having a ridiculously hard time to get paths to be recognized within aspx pages. here is what i found (using VS 2003) /images/img.gif is invalid in VS, doesn't work in browser .../images/img.gif is valid in VS, but does not display in browser http://localhost/Test1/images/logo.gif works images\logo.gif works in browser, but not in design mode (this also assumes your are in a page at the root level. \images\logo.gif doesn't work in either this is nuts! or i'm just stupid.... every other language i've dealt with the "/" would be the root and if your pics are in the images directory then "/images/xyz.gif" would access it. what the hell am i missing? thanks :) Simon,
Why not just import an image in your solution in the imagefolder of that Than set the image property as I told in the other message "image button" to that image. I hope this helps (I am not 100% sure), Cor hi again. thanks as always for the replies. i was trying to reuse
some existing html i have from previous projects. and when you code html in the "code view" it seems to not resolve paths correctly, sometimes in the design view or in the executed browser display. do all vb.net programmers do everything via dragging objects in and setting properties, would think straight coding in the code view is used as much? i'm sure most has to be because i'm new to this language/platform. this is an odd one. if i had to recreate all this stuff by dragging,dropping, prop setting it would take a serious long time. hope there is something i can do. thanks again. this group is awesome for help and it is really appreciated!!! Show quoteHide quote >Simon, > >Why not just import an image in your solution in the imagefolder of that >Than set the image property as I told in the other message "image button" to >that image. > >I hope this helps (I am not 100% sure), > >Cor > Simon,
Although HTML and Javascript has been a long time very easy for me (it still is, however now I have to remember me more), do I try to avoid to write in ASPNET as much as possible in HTML and Javascript. Reason, I don't want to let the user direct when he does "Source Code" to show him everything. (Although in this case it will be direct placed in the attributes from the control). Why would I not use the property box or other things like that, that give me good maintanable programs Just my thought, :-) CorHi,
Try ~/images/img.gif Ken ------------- Show quoteHide quote "simon" <m*@here.com> wrote in message news:rpsau19m674th3kt5qegf77o0j178i11be@4ax.com... > hello, > i almost feel stupid asking about this topic, but since i'm new to > vb.net what the hell.... > i'm having a ridiculously hard time to get paths to be recognized > within aspx pages. > here is what i found (using VS 2003) > > /images/img.gif is invalid in VS, doesn't work in browser > ../images/img.gif is valid in VS, but does not display in browser > > http://localhost/Test1/images/logo.gif works > > images\logo.gif works in browser, but not in design mode (this also > assumes your are in a page at the root level. > > \images\logo.gif doesn't work in either > > this is nuts! or i'm just stupid.... > > every other language i've dealt with the "/" would be the root and if > your pics are in the images directory then "/images/xyz.gif" would > access it. > > what the hell am i missing? thanks :) > hello. thanks for the reply, that only works if the image is pulled
in via the toolbar. what i was looking to do is some straight html coding via the "code view". that is where i'm getting killed.... Show quoteHide quote > > Try ~/images/img.gif > >Ken Hi,
Take a look at server.mappath Ken ----------------------- Show quoteHide quote "simon" wrote: > hello. thanks for the reply, that only works if the image is pulled > in via the toolbar. what i was looking to do is some straight html > coding via the "code view". that is where i'm getting killed.... > > > > > Try ~/images/img.gif > > > >Ken > > (Server.MapPath won't really help him if he's trying to straighten out how
to reference paths in basic HTML in ASPX pages.) Simon, it sounds like you're used to always working in a web site's "root." ASP.NET apps like to be in subfolders. :-) For basic HTML (non ASP controls): images/logo.gif: This is what I think you're looking for. It means the images subfolder is in the same folder that the page is in. Note the lack of the first forward slash. In your example you tried this but with a backslash instead of the standard html forward slash. /images/logo.gif: means the images folder is in the *root of the web server* regardless of the page OR your web application's subfolder. This is not a "relative" path. By the way these are client-side browser semantics... not ASP.NET. ~/images/logo.gif only works for server-side controls. Browsers have no idea what ~/ means. Show quoteHide quote "Ken Tucker [MVP]" <KenTucker***@discussions.microsoft.com> wrote in message news:69AA9F94-2D5C-46DD-B84B-275BBF7EEC65@microsoft.com... > Hi, > > Take a look at server.mappath > > Ken > ----------------------- > > "simon" wrote: > >> hello. thanks for the reply, that only works if the image is pulled >> in via the toolbar. what i was looking to do is some straight html >> coding via the "code view". that is where i'm getting killed.... >> >> > >> > Try ~/images/img.gif >> > >> >Ken >> >>
Newbie Question 2, Reference To Controls On A Form
Problem to write a good serie of bytes in a file. Report writers for VB.NET making image click fire codebehind function? current working directory problem Problem Communicating Between Forms late bound form reference Newbie Question Saving Projects Calling Program A from Program B help with multiple forms on asp.net 1.1 page, please |
|||||||||||||||||||||||