Solved

Javascript doesn't work on loginpage

Posted on 2015-02-11
3
66 Views
Last Modified: 2015-03-04
My website has a login-page on which you need to enter your username and password.
All goes well when you click the login-button, you are then redirected to the startwebpage.
However, I also want my visitors to login using enter after entering their username and password.
Therefore I've used Javascript.

Problem is that the Javascript is not executed, probably because you're not logged in yet.
I have Forms Authentication, and my guess is that I have to add something in the web.config like:

   <location path="login.aspx">
    <system.web>
      <authorization>
        <allow users="*" />
      </authorization>
    </system.web>
  </location>

This does not do the trick, I hope somebody can help me with this.
0
Comment
Question by:adiemeer
3 Comments
 
LVL 21

Accepted Solution

by:
Craig Wagner earned 167 total points
ID: 40604727
JavaScript has nothing to do with whether you are logged in or not, it executes in the browser. Post your JavaScript, it probably has a bug in it.
0
 
LVL 96

Assisted Solution

by:Bob Learned
Bob Learned earned 167 total points
ID: 40604781
What type of ASP.NET web site are you working with?

With a web forms web site, there is the Panel.DefaultButton property, that you can use to set the button for the <Enter> key.

Using the DefaultButton Property of a Panel in ASP.NET
http://www.aspnettutorials.com/tutorials/controls/defaultbutton-panel-aspnet/
0
 
LVL 35

Assisted Solution

by:Miguel Oz
Miguel Oz earned 166 total points
ID: 40604889
Did you check that JavaScript is enabled in your browser?
To test it, Just add the noscript tag to your html:
<noscript>Your browser does not support JavaScript!</noscript>
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
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…

776 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