Link to home
Start Free TrialLog in
Avatar of BROOKLYN1950
BROOKLYN1950Flag for United States of America

asked on

I just can't get my web page to work

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?
Avatar of Jerry Miller
Jerry Miller
Flag of United States of America image

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.
Avatar of BROOKLYN1950

ASKER

@jmiller1979
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.
Avatar of Soluga
Soluga

When you have the page open for edit in VS what happens when you press F5 on your keyboard?
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:
User generated imageAlso 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:
<authorization>
      <deny users="?"/>
</authorization>

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.
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.
ASKER CERTIFIED SOLUTION
Avatar of BROOKLYN1950
BROOKLYN1950
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I figured out the answer before anyone else did.
Glad you got it working, that is the ultimate goal. Yup, sometimes you figure it out be we do.