Don't look for myapp folder, look for images folder and don't use
absolute paths...use relative paths.
for example if we have directory structure like
myapp/Images
myapp/css
myapp/UserPages
You can reference the myapp folder (root folder) with ~ operator
The following example shows the ~ operator used to specify a root-
relative path for an image when using the Image server control In this
example, the image file is read from the Images folder that is located
directly under the root of the Web application, regardless of where in
the Web site the page is located.
<asp:image runat="server" id="Image1" ImageUrl="~/Images/
SomeImageInImagesFolder.jpg" />
in css folder's css file you reference to image like this:
.someclass
{
background-image: url(../Images/SomeImageInImagesFolder.jpg);
}
You don't need to reference "myapp"
Stefan Brandt
Helsinki, Finland
On Apr 22, 11:04 am, JaffaB <[email protected]> wrote:
> Sorry, I dont get it. How does IIS sort out the fact that in my
> application, in a development environment, I am looking for a
> directory ( /myapp/ ) which does not exist on the deployed solution.
>
> In development, it has a directory structure of...
>
> localhost/myapp/images/image.jpg
>
> and in the production environment it has
>
> domain/images/image.jpg
>
> How does (or how do I tell IIS) to resolve the fact that there is one
> less level to the directory structure?
>
> On Apr 21, 4:13 pm, bala murugan <[email protected]>
> wrote:
>
> > Hi
> > you just need to publish or host the application in IIS (ASP.net pages and
> > Images)
> > automatically it will retrieve your image.
>
> > No need to handle for developemnet server and IIS running environment,
>
> > Thanks
> > Bala.http://www.balaweblog.com
>
> > On Wed, Apr 21, 2010 at 5:41 PM, JaffaB <[email protected]> wrote:
> > > All,
>
> > > I have created my 1st ASP.NET <http://asp.net/> which we will be moving
> > > onto a hosted
> > > web app server. But, I am confused by the URL pointers, and wonder
> > > if somebody could advise me. When I run my application in Visual
> > > Studio, it runs on the local host development enviromnet and the URL
> > > is something like...
>
> > >http://localhost:1266/MyApp/
>
> > > Now, when I want to load an image in my dev environment, I load it
> > > from "/MyApp/Images/image.jpg", and when I redirect I redirect to "/
> > > MyApp/UserPages/Mypage.aspx" - all good, all working.
>
> > > But, when I place my app on the live web server, the base address
> > > changes to
>
> > >http://www.myaddr.com/
>
> > > So the image will be stored in "www.myaddr.com/Images/image.jpg"
>
> > > So how do I reference the two URLs - I still want the application to
> > > work on the development box, but when compiled and deployed, I need it
> > > to work on the web domain.
>
> > > I know its a starter for 10 easy questions, I am just confused -
> > > sorry.
>
> > > --
> > > Subscription settings:
> > >http://groups.google.com/group/dotnetdevelopment/subscribe?hl=en
>
> > --
> > Thanks,
> > Bala.http://balaweblog.wordpress.com