tags:

views:

30

answers:

1

Hello,

While I'm using Response.Redirect("~/Pages/Page.aspx"), style is loaded on the page, but unfortunately it is not loaded while I'm using Server.Transfer("~/Pages/Page.aspx") method.

The page looks following:

<html>
<head runat="server">
   <link href="../Css/Layout/style.css" type="text/css" rel="stylesheet" />
</head>
<body></body>
</html>

How to make the page load style.css using Server.Transfer() ?

Regards

+1  A: 

The problem is that you use a relative path to your CSS file, you should use an abolute path.

If the css folder is inside your application root, you can use

<html>
<head runat="server">
   <link href="/Css/Layout/style.css" type="text/css" rel="stylesheet" />
</head>
<body></body>
</html>

or even

<html>
<head runat="server">
   <link href="~/Css/Layout/style.css" type="text/css" rel="stylesheet" runat="server" ID="aUniqueId" />
</head>
<body></body>
</html>
Andreas Paulsson
Unfortunately, that is not working for me.
Jarek Waliszko
Could you tell us 1. what is the absolute path (with host name) of the page that you are transferring from and 2. what is the path (with host name) of the css folder.
Andreas Paulsson
@Andreas: Actually I realized, that the source of the problem is a bit more weird, so I've created new thread for that: http://stackoverflow.com/questions/3896203/application-error-exceptions-handling-redirection-infinite-loop-and-css-loading
Jarek Waliszko