My asp.net 1.1 site will not refresh - asp.net

I have an ASP.NET 1.1 site and I'm uploading a small change, but the page will not refresh. The page was changed 2.5 hours ago. I have tried loading the page in 3 different browsers, so I know the issue is not browser caching. I searched for similar situations on the web and StackOverflow. I have tried changing the query string, deleting the file and uploading again, and changing web.config to try to force a site restart.
I even uploaded the file under a different name to make sure there was not another problem. That did work, but I don't want to change all of the links to point to a new page. I even tried using Remote Desktop to log into another computer at another client to check if the cached version of the page is there too... it is.
The site is co-located using shared hosting, and my (new) client doesn't even know how to find the URL for the administrator's panel or who to call for support.
Using Whats that site running?, I found out what the server is running:
Windows 2000
Microsoft-IIS/5.0
ASP.NET v1.1
F5 Big-IP
I know! Crummy host!
I'm sure in a day or so I'll contact support and clear this up, but I'll still want to know how this page is cached. I have been programming ASP.NET for 5 years and don't remember anything like this before. I don't think there is a proxy caching the page, but so far that is the only thing I can think of.
Thanks for any ideas in advance...
EDIT: Code sample... This appears to be a single page ASPX page, no code behind.
<%# Page Language="C#"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head runat="server">
<title>Login</title>
</head>
<body>
...
</body>
</html>

If it's not patched, then it could suffer from an old bug where the Temporary ASP.NET Files aren't updated correctly.
If that's the case, be glad it went wrong this way - it can also go wrong in such a way as to throw compilation bugs on random pages throughout your application. If that's the case then restarting may be required. Or worse, stopping, clearing that directory, and then starting.
For both this, and some other compilation mis-fires, you could try introducing a null change (add a space, delete the space) to the global.asax. This can trigger an entire recompilation.

Related

Web app on server not reading style sheets

I am not sure why when I place the web app on the MS server 2008 R2 that it is not reading the style sheets on any pages.
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<link href="/styles/StyleSheet1.css" type="text/css" rel="stylesheet" />
The masterpage has no styles on it or anything on it except the ToolkitScriptManager. I placed it there for future use if needed.
Viewing the source shows the style links there and if I take a link and past it in the url the style sheet appears, so yes, it's there on the server.
http://serverName/WebAppName/styles/StyleSheet1.css
This occurs in all browsers.
The styles are being read in Visual Studio 2010 when debugging.
I tried placing a tilde (~) in front of the reference
link href="~/styles.....
This had no effect.
I tried removing the first forward slash even though I knew this was wrong.
I have been through the server configurations but with no luck.
I there a configuration in the server I am missing? It's been about two years since I had to do any configurations but it is nice to have access to the servers once again.
Thanks for any responses...
After doing a bit of research I found the answer and wanted to post it for a reference to others.
Yes, the link to the css file was broken after testing with Firebug.
Why was it broken? It was from the server.
When creating a directory in IIS for a new site, there are some choices.
I made the choice to create a new virtual directory under the Default Web Site directory.
Old habits die hard from my .Net 1.0 days.
This means the page was looking for the css folder in the wrong place and the href needed to be changed to href="styles/... without the first forward slash.
But when there are a LOT of pages to make changes, this is not a good idea.
What I did and should have done in the first place was create a NEW web site under the Sites folder in IIS. This way it's not a new Virtual Directory and the relative paths throughout the site are now correct.
I hope this post helps someone else in the future.
Thanks for all the replies and suggestions!!!

Drupal showing blank page after migrating to a local server

Firstly some background,..
IVe started a new job as PHP developer with a company that hosts 2 Drupal (6.x) sites.
While I have years of experience in PHP, Drupal ( and indeed off the shelf content management systems in general ) is a new one on me. Still, there is loads of documentation and its not rocket science, so no problems there.
The server environment is IIS (live server 7.0, locally 7.5) IIS is a totally new beast to me too, so it adds to teh learning curve.
I have successfully gotten a clean install of Drupal (7.x) to run locally, so I know the server is up and running correctly
The problem happens when I try to pull down the live site. I have replicated the database locally, and I know that it is connecting, however when I try to run the local site I get a blank page with the following source c ode:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en">
<head>
<?include '_inc_head_common.tpl.php';?>
</head>
<body id="body">
<?include '_inc_header.tpl.php';?>
<?include '_inc_content_3col.tpl.php';?>
<?include '_inc_footer.tpl.php';?>
</body>
</html>
So it seems that it is getting to a point and no further..
has anyone encountered this before or could someone point me in the direction that I should be looking at?
Thanks
Kevin
Check your PHP configuration on your dev PC. That page is using PHP Short Open Tags (<? instead of <?php) which may not be enabled on your machine. You can find the setting in your php.ini file.
and I know that it is connecting,
Did you enter correct new database login information in sites/default/settings.php ? (write protected by default).
Also, it doesn't look like you have the correct source code. This code should be a theme's page.tpl.php file (sites/all/[theme-name]/page.tpl.php or themes/[theme-name]/page.tpl.php.).
We don't use include in this way either. There are predefined names (html.tpl.php, page.tpl.php, node.tpl.php etc that nests automatically) that gets included automagically.
See: http://drupal.org/node/158043
Also, Drupal requires its own .htaccess file placed (or at least the functionality somewhere in a httpd.conf file) in order to handle cleaner URLs and file protection.
If you can't access a specific URL, e.g. http://localhost/user , try http://localhost/?q=user

ASP.NET site takes 10 seconds to load basic Hello World page but is instant on second load

I have a ASP.NET program that works just fine but takes 10 seconds to load the default.aspx page, if I close the browser and quickly reopen the browser and enter the same URL then the page loads almost instantly. I have compiled my code and published the site so it contains dlls so it shouldn't need to compile. This delay is problem for me as my program is designed to get the data as quickly as possible.
My test.aspx page contains the code below. I have a placed this page within my programs web site so it is using the same web.config.
<%# Page Title="Test" Language="VB" %>
<html>
<head runat="server"></head>
<body><h2>Hello</h2>
<p><%Response.Write(now())%></p>
</body>
</html>
Can anyone help me remove the startup delay?
Many thanks
James
Even if the code is compiled it will still need to be loaded, possibly into a new application domain which might be taking some time.
One solution is to keep the application alive by regularly pinging the website from an external service.
E.g. www.keepaliveforever.com
Change your application pool idle timeout settings in iis
There is no easy answer, you'll probably need to look at a stack trace to figure it out. Observe what code is running and how much time it is taking to execute. Remember, the first time you visit your site your application has to load into memory and various things are happening in the background.

Security problem

I have a security problem in my website. A script code was added into my all pages like "<script src="Ip address/viewpic.asp"></script>" . It is between </head> and <body> tag. Now Google says "this site may be hartful for your pc!" about my site. How can i secure my website? I use C# and Visual Studio 2008.
You have been hacked. This code that has been added to your site is trying to hack web browsers that visit your site.
This could have happened a number of ways. The easist thing for you to do is to download an anti-virus like AVG and scan any machines with access to the site. There is malware that looks for FTP connections, it grabs the username/password then logs in and modifies files it finds. You should be using SFTP which can be installed under windows, FTP is only used by people who don't know any better or love to get hacked, or both.
The more complex possibility is that there is a vulnerability in your site. This requires a professional (Like me) to track down and fix. Acunetix can help find flaws in your site, but this might not find the vulnerability that was used to break in.
Edit: Assuming that the script is your own and not malicious:
You should not have any code between </head> and <body> - Otherwise you have got a <script> tag as a direct child of <html> which is not allowed.
Put the <script> tag inside <body> at the correct place where you want the script to execute, to correct the structural issue but you need to provide some more information about the exact error messages you are seeing about security as I'm not aware that Google shows error messages within its search listings and I dont have Google Toolbar installed to know what that does; but I don't believe it has typos in it ;)
So please provide more information about the exact security warnings once you've fixed - and validated (with the W3C Validator) - the structure of your HTML.
Edit: If the script is not intended to be there and has appeared outside of your desire:
Have a look in the HTML source where the script is present; and compare to your own ASPX pages to find out where the script is appearing. If it is being rendered by one of your controls you need to examine where the value is coming from. If it is a database, you need to focus your attention on what gets the information into the DB in the first place. If the script is injected and not into one of your controls then you should talk to your ISP I would think.

CSS file not getting downloaded in Visual Studio 2008 SP?

This might sound a little wierd, but all of a sudden the CSS and Javascript files referenced in my master page are not being downloaded while the page is being rendered. I am working on a ASP.NET MVC project and things were all fine like half an hour ago!
Here is what I have in head section of the master page,
<link href="/Content/MyCSS.css" rel="stylesheet" type="text/css" />
<script src="/Scripts/jquery-1.3.2.min.js" type="text/javascript"></script>
I can see the CSS class intellisense while designing pages. But in the page source I do not see these files being added. I can see the css being applied in the VS designer. I have tried restarting VS, restarting my machine too.
Anyone else faced this situation before. I might go crazy now.
Sounds odd. I would use Microsoft Fiddler to see if that gives you any clues. Also are you using IIS or the built in Web server?
If you are using some kind of source control, you might also want to review your recent changes.
Check that your paths are correct. You can create a web app in a virtual directory off the root, so you path would be "/myapp/default.aspx", in which case your paths for your css and js would be wrong.
Try to avoid putting absolute paths in file references.
You may want to try and remove the leading slash, for example.

Resources