Solved

I just can't get my web page to work

Posted on 2013-12-10
9
510 Views
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?
0
Comment
Question by:BROOKLYN1950
9 Comments
 
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.
0
 
LVL 50

Expert Comment

by:jcimarron
ID: 39709852
0
 

Author Comment

by:BROOKLYN1950
ID: 39710319
@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.
0
 
LVL 1

Expert Comment

by:Soluga
ID: 39711234
When you have the page open for edit in VS what happens when you press F5 on your keyboard?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:BROOKLYN1950
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:
<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.
0
 
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.
0
 

Accepted Solution

by:
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">
        <system.web>
            <authorization>
                <deny users="?" />
            </authorization>
        </system.web>
    </location>

Open in new window

0
 

Author Closing Comment

by:BROOKLYN1950
ID: 39744512
I figured out the answer before anyone else did.
0
 
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.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
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)
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now