Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / IDE / August 2008

Tip: Looking for answers? Try searching our database.

img tag ../ ./ / ???

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul Hale - 08 Nov 2005 12:26 GMT
Hi,

This is my set up...

Root (.aspx file for non-authenticated users)
Root\Members (.aspx files for authenticated users)
Root\Images (images for entire web site)

My MasterPage resides in Root.

I would like my masterpage to contain html img tags (as opposed to .net img
server controls). This is to save overhead on my server.

I have set the "Src" property of the HTML image tags to
"/Images/myimage.gif". This seems to work fine and all pages from root and
root/members display images fine when browsing with a broswer. However, in my
VS2005 designer mode the images dont show. I love the new MasterPages concept
but would love them even more if I could get the images to display when in
design mode giving me a pretty close wysiwyg at design time.

Please help! pretty please!

Regards,

Paul.
Richard Hein - 08 Nov 2005 14:54 GMT
It's funny that we seem to have exactly the opposite problem.  I can see the
images while designing, but not browsing.

- Richard Hein

> Hi,
>
[quoted text clipped - 24 lines]
>
> Paul.
Steven Cheng[MSFT] - 09 Nov 2005 06:58 GMT
Hi Paul,

As for the html <img> tag's image source url problem, based on my local
test, the following style URL won't work no matter in design-time IDE or
runtime browser...

"/Images/myimg.jpg"

Actually, the "/Images/myimg.jpg" style url is an absolute path which means
the path is start from the IIS website (not asp.net site)'s root folder. So
if your application is directly under IIS site's root, named "MyApp" and it
contains an "Images" subfolder, the images in that folder's url should be:

"/MyApp/Images/xxxx.jpg"

That's why I mean the "/" began url will work only if we web application is
directly under IIS site(mostly this is not the case...)

For ASP.NET Image Server Control, because it can use the "~/..."  
Application relative path which means start from the Applicaiton's root
dir, so it will work well. However, since normal html elemetn won't been
parsed by ASP.NET ruhtime so we can not directly use "~/...." path in
static html. To workaround this, we can embeded asp.net code inline within
the html <img ..> tag so as to specify Application relative path, for
example:

<img src='<%= ResolveUrl("~/Images/rand.jpg") %>' />

the out put at cilent side will be

<img src="/ApplicationPath/Images/rand.jpg" />

Also, as I've mentioned, the "/xxxx/xx" style Url means start from IIS
site, if you don't mind that we embeded the application's full path in to
the url string, you can also use this absolute style path.

If there're anything unclear or any other questions, please feel free to
post here. Thanks,

Steven Cheng
Microsoft Online Support

Signature

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| From: "Richard Hein" <Auxon@noemail.noemail>
| References: <47B447D0-03A8-4501-B580-29E43629C1C2@microsoft.com>
[quoted text clipped - 46 lines]
| >
| > Paul.
Steven Cheng[MSFT] - 16 Nov 2005 14:23 GMT
Hi Paul,

Any progress on this issue? Does the suggestions in my last reply helps a
little? If there're anything else we can help, please feel free to post
here.

Thanks,

Steven Cheng
Microsoft Online Support

Signature

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
| X-Tomcat-ID: 125310623
| References: <47B447D0-03A8-4501-B580-29E43629C1C2@microsoft.com>
<uFe#$QH5FHA.3312@TK2MSFTNGP15.phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain
[quoted text clipped - 92 lines]
| | >
| | > I would like my masterpage to contain html img tags (as opposed to
net
| | > img
| | > server controls). This is to save overhead on my server.
[quoted text clipped - 16 lines]
| | >
| | > Paul.
ManniAT - 14 Nov 2005 07:54 GMT
Hi Paul,

this is some kind of a "unable to act with root web feature" in VS.
We had a lot of discussions here http://forums.asp.net/988333/ShowPost.aspx

As long as you keep the things in a "projekt subdir" and address via relative paths
it works. If you use absolute paths the designer fails since VS always assumes
a file system web must be in a subdir.

This is from my point of view a massive restriction. It is there (and discussed) since the betas.
And MS kept it in RTM.

Regards

Manfred
Paul Hale - 11 Aug 2008 12:26 GMT
Thanks Steven,

This probelm seems to have vanished since I upgraded to VS2008.

> Hi Paul,
>
[quoted text clipped - 11 lines]
>
> Manfred

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.