[Webinar] Streamline your web hosting managementRegister Today


I just can't get my web page to work

Posted on 2013-12-10
Medium Priority
Last Modified: 2013-12-30
I have never seen a more infuriating problem than this. Okay, I am building my first website using ASP.NET. I’m still a little new to HTML, CSS, ASP, etc, but I’m very used to .NET and Visual Studio. I started out with the default Web Forms template, and began modifying the Site.Master file and Site.css file to fit my site.
      I finished my home page with great results (for a first timer, most of it was just the header and footer taken from the master page), and decided to move on to my login page. After researching the built in ASP.NET login controls and messing around with page itself, I noticed that I was getting some JavaScript errors on my login page.
      I would show you what they were except that I can’t get to them right now. Why? Well I’ll explain. After messing around with the page for a few minutes trying to figure out what I messed up that could be causing the errors, I decided to simply role back that page to how it was two days before, since I hadn’t made too many changes to that page anyway.
      So I downloaded a copy of the project and copy/pasted the HTML from the old Login.aspx, to the active one (I did the same for my Login.aspx.vb). No errors! So I left my computer and ended off for the day, thinking I would just start over with that page, step-by-step, and figure out what caused the error.
      But when I got back to my computer today, things got really messed up. First off, when I loaded the page (before making any changes) the errors came back. So I went back into my old aspx file and re-copied the HTML (top to bottom, just like before). But this time when I reloaded the page, something different happened.
      Now keep in mind I did not make any change to the Site.Master page this whole time. But when I reloaded my login page, it gave me the page as it looked two days before, including the outdated header which at that time I was still in the middle of creating.
      So I figured it must be cached somewhere. In Internet Explorer: I tried Ctrl-F5 (which worked in the past); nothing, I tried clearing the cache (Safety->Delete browsing history…->Temporary internet files); nothing, I tried changing the cache settings (Internet Options -> General -> Settings [in Browser History section] -> Every time I visit a web page); still nothing.
      In Google Chrome I tried: Ctrl-F5 (which worked in the past), clearing the cache (Settings -> Show advanced settings… -> Clear browsing data ->Obliterate the following items from the beginning of time -> Empty the cache), and disabling the cache in the DevTools (F12->Settings -> General -> Disable cache (while DevTools is open)).
      None of these things worked, both browsers still showed the same outdated version of the web page. Now, any sane person might think that I changed something in the Site.Master file to set it back to how it used to be, but I’ve double checked the source code and it is still up to date. Cases in point being two buttons from the original template which I deleted from the source yet are still there somehow.
      Some interesting things to note are that if I open the web page in the Page Inspector is comes out right (so the source has definitely not been changed) and that after I rebooted the machine, I was able to use Ctrl-F5 to reload the page and it did come up correctly (but with the JS errors too). After that though I tried recopying the old HTML again to fix the errors, which promptly reset the header the the outdated form it was in before I restarted.
      So that’s my long story: a problem within a problem. Any ideas?
Question by:BROOKLYN1950
LVL 18

Expert Comment

by:Jerry Miller
ID: 39709566
I am assuming that the page looks correct in Visual Studio on the dev computer? If so, do a Rebuild Solution and copy your files back to the web server. After you have the updated files on the web server, you should see the correct version in all browsers.

Another question that I have. How is the site hosted? If it is on a service (Go Daddy, Host Gator, etc..), you may have multiple servers that are involved and there could be a replication issue with your hos service.

Without seeing your old and new HTML, it is hard to even begin to help troubleshoot the javascript error issue.

Author Comment

ID: 39710319
Sorry, I left this part out. I haven't moved the site to any publicly accessible location yet, I'm running it straight out of Visual Studio. I select my browser from the toolbar on top and then click Run (just like you would click in a win-forms project), it then runs the site using whatever built-in-IIS-thing which it has installed.
As far as the JavaScript error is concerned, I'm not too worried about that at the moment since I can't even get my page to load correctly. Besides, the errors weren't even coming from my JavaScript, they were coming from whatever JavaScript Visual Studio loads into the web page. I haven't even opened a single JavaScript file in this project.
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.


Expert Comment

ID: 39711234
When you have the page open for edit in VS what happens when you press F5 on your keyboard?

Author Comment

ID: 39711639
Okay, I don't know what I did differently, but when I came on today and hit F5 the site loaded correctly. So before I tried anything else I took a snapshot of the JavaScript errors I'm getting. This is what they look like out of the chrome browser:
A screenshot of the Google Chrome consoleAlso as I was writing this, I figured out what I did to cause them. Aside from the Site.css and the Site.Master, I also made a slight change to the web.config file, I added:
      <deny users="?"/>

Open in new window

I got the spinet from some Google searches, In an attempt to redirect all non-logged-in users from browsing the site. It works, but apparently whenever they are redirected to the log-in page I get these JavaScript errors. If I take out the above code from the config file, I can load the page without any errors, but unauthorized users can browse the site.
So naturally I started messing with the config file seeing if I could tweak it to get the intended results. Unfortunately I never found out whether or not my tweak worked because as soon as I made a single change to the config file and reloaded the page, I got the same outdated version of the page I had been getting yesterday. WHERE IS THIS OLD PAGE COMING FROM!?
So anyway, now I'm stuck until it decides to show me the right web page or until we can figure out why it's showing the old page to begin with.
Fingers crossed.
LVL 18

Expert Comment

by:Jerry Miller
ID: 39711869
You need to put a breakpoint in the Page_Load event and follow the progression of the page. Both when it works and when it doesn't. Also take a look at the solution and make sure that there isn't any old pages left that could be causing the issue.

Accepted Solution

BROOKLYN1950 earned 0 total points
ID: 39738651
Sorry for the delay, I figured it out a few days ago. I'm sorry to say that none of your suggestions fixed my problem.
The problem was in that change I made to the web.config file, I'm not 100% sure why but it seems like it was denying access to allot more than just my web pages. I think it was denying access to pieces of the site that my log in page was referencing, resulting in a failure to load the page and thus some run-time errors. I'm not sure where that old version of the page was saved/cached but once I fixed the web.config file it stopped appearing and everything went back to how it should be.
Instead of denying access to the whole site (as shown in the snippet from my previous post),  I denied access to the specific web pages that I did't want any unauthorized access to using code like this:
    <location path="~/Default.aspx">
                <deny users="?" />

Open in new window


Author Closing Comment

ID: 39744512
I figured out the answer before anyone else did.
LVL 18

Expert Comment

by:Jerry Miller
ID: 39747062
Glad you got it working, that is the ultimate goal. Yup, sometimes you figure it out be we do.

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

612 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question