The machine is not content to be bested by me. The epic battle of woman vs. microchip continues…
In the process of coding, debugging, coding, debugging Websites and using HTML I am often convinced I have to troubleshoot a phantom. The code is interpreted and presented in some way that the machine sees fit. Weird results appear – confirming the fact that ghosts, indeed, do live in the machine.
A hyperlink is a hyperlink, right? Simple – a way to jump from one place to another. It can be in the same page – go from the bottom to the top. Go from one page to another – home page to contact us. Go from one website to another – my blog to a Wikipedia entry. It’s a way to navigate through “the cloud”. We’ve all used them and most of us have put them on our websites, our blog entries, and our email.
Well, I was doing some work on a school project in ASP.NET putting some security on a website. If the user was not already signed into the website (unauthorized), the website would automatically redirect them to the login page so they could sign in. We’ve all seen that and used it a million times. Simple. I had that working fine. Then I added a registration page so if the user didn’t already have a login, they could register and sign in to the website. Also pretty simple. The project built fine – no errors or compilation problems reported. I published the website. It started just fine – went the login page. I clicked the hyperlink to go to register on the registration page. I blinked. Nothing happened. The login page stayed there. So I did what any rational programmer with a few years of experience would do. I clicked the link a few more times to convince the computer that it needed to follow my directive and go to the registration page. It refused.
Muttering under my breath (I am no longer in the manufacturing plant where we say what is on our minds), I recreated the problem from scratch. I closed the browser (IE), reopened it, and typed in the web address. I checked the link showing in the page when I started the application: http://localhost/benefits/login.aspx?ReturnUrl=/benefits/default.aspx
For those of you who don’t know, default.aspx is what Microsoft names the homepage of your website if you don’t change it. I’m doing schoolwork and the project was set up that way. The rest of the information is showing that the user is redirected to a login screen because unrecognized users need to get permission to use the site. That’s the way the link should look.
Then, I clicked on the “register” hyperlink which should have sent me to a “register.aspx” page. When I clicked on the link, I stayed on the current login page, but the link now read: http://localhost/benefits/login.aspx?ReturnUrl=/benefits/reigister.aspx
Nuts! That made no sense! I got the teacher for help. He confirmed that the file containing all the pages were in the right place and that the hyperlink was spelled correctly. That should work! We both agreed. The computer was dumb enough not to realize it was wrong.
Now, at this point, if there is one of you out there who can hazard a guess as to the final solution to this puzzle, email me at email@example.com. I will post the solution and the explanation tomorrow.