login working in IE but not mozilla?

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Jun 2005
Posts: 6
Reputation: Sycophant is an unknown quantity at this point 
Solved Threads: 0
Sycophant Sycophant is offline Offline
Newbie Poster

login working in IE but not mozilla?

 
0
  #1
Jun 16th, 2005
Hi,

Stone me now. I am not a programmer or even a web developer. I am however falling victim to a strong learning curve - I have been asked to look at a site that is having a problem and fix it, and its imperative that I do so

The problem that I am having is with a page called login.aspx - this is obviously a login page. Everything works great in mozilla. When I call the page up in IE the page loads fine, but nothing happens when I enter a used id and submit.

The code, from what I can tell, on the formside looks very standard, almost as if it was cut and pasted from a tutorial.


  1. <form id="Form1" method="post" runat="server">
  2. <h3><font face="Verdana">Login Page</font></h3>
  3. <span class="Normal">Company ID:</span> <br>
  4. <input class="NormalTextBox" id="CustomerCode" type="text" name="UserEmail" runat="server">
  5. <ASP:REQUIREDFIELDVALIDATOR id="Requiredfieldvalidator1" runat="server" ErrorMessage="You Must Enter a Valid Company ID." Display="Static" ControlToValidate="CustomerCode" Width="276px" cssclass="NormalRed"></ASP:REQUIREDFIELDVALIDATOR>
  6. <br>
  7. <br>
  8. <ASP:CHECKBOX id="PersistForms" runat="server" autopostback="true" text="Remember me" cssclass="Normal"></ASP:CHECKBOX>
  9. <br>
  10. <br>
  11. <asp:imagebutton id="SigninBtn" runat="server" ImageUrl="~/images/signin.gif"></asp:imagebutton><br>
  12. <asp:label id="Msg" runat="server" cssclass="NormalRed"></asp:label>
  13. </form>

The authentification portion of the web.config reads like this :

  1. <authentication mode="Forms">
  2. <forms loginUrl="login.aspx" name=".ASPXAUTHSC" protection="All" timeout="60"/>
  3. </authentication>

Finally, the login.aspx.vb is apparently some stock code generated from some code generator...

  1. Imports System.Security
  2. Imports System.Web.Security
  3.  
  4. Public Class Login
  5. Inherits System.Web.UI.Page
  6. Protected WithEvents Requiredfieldvalidator1 As System.Web.UI.WebControls.RequiredFieldValidator
  7. Protected WithEvents PersistForms As System.Web.UI.WebControls.CheckBox
  8. Protected WithEvents Msg As System.Web.UI.WebControls.Label
  9. Protected WithEvents SigninBtn As System.Web.UI.WebControls.ImageButton
  10. Protected WithEvents CustomerCode As System.Web.UI.HtmlControls.HtmlInputText
  11.  
  12. #Region " Web Form Designer Generated Code "
  13.  
  14. 'This call is required by the Web Form Designer.
  15. <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  16.  
  17. End Sub
  18.  
  19. Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
  20. 'CODEGEN: This method call is required by the Web Form Designer
  21. 'Do not modify it using the code editor.
  22. InitializeComponent()
  23. End Sub
  24.  
  25. #End Region
  26.  
  27. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  28. 'Put user code to initialize the page here
  29. End Sub
  30.  
  31. Public Sub Login_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles SigninBtn.Click
  32. Dim security As New ASPNetPortal.UsersDB()
  33.  
  34. Dim userId As String = security.Login(CustomerCode.Value.ToString())
  35.  
  36. If Not (userId Is Nothing) And userId <> "" Then
  37. FormsAuthentication.RedirectFromLoginPage _
  38. (userId, PersistForms.Checked)
  39. Else
  40.  
  41. Msg.Text = "<" & "br" & ">Login Failed!" & "<" & "br" & ">"
  42.  
  43. End If
  44.  
  45.  
  46.  
  47. End Sub
  48.  
  49.  
  50.  
  51. End Class

I know enough about this to get myself into a heap of trouble, and im probably looking in the wrong place. For all I know it could be a browser issue for end users who dont have the right browser version or .net version running. I dont know.

Any help would be appreciated, if you need more info feel free to let me know!


Mike E
Reply With Quote Quick reply to this message  
Join Date: Feb 2003
Posts: 793
Reputation: Paladine has a spectacular aura about Paladine has a spectacular aura about Paladine has a spectacular aura about 
Solved Threads: 26
Team Colleague
Paladine's Avatar
Paladine Paladine is offline Offline
Master Poster

Re: login working in IE but not mozilla?

 
0
  #2
Jun 17th, 2005
Ok, I am tired so bare that in mind.

But where is the event tied to the SignIn ImageButton? That is the submit button correct?

Is the code for this Login_Click is not tied to any object in the HTML side of the ASP.Net page?

Saying that, I am surprised it worked in Mozzilla. But from the code you have provided, the only reason it would not work is for the simple fact that there is not event coded for the On_Click of the ImageButton (your signIn Button).


Hope this helps

Originally Posted by Sycophant
Hi,

Stone me now. I am not a programmer or even a web developer. I am however falling victim to a strong learning curve - I have been asked to look at a site that is having a problem and fix it, and its imperative that I do so

The problem that I am having is with a page called login.aspx - this is obviously a login page. Everything works great in mozilla. When I call the page up in IE the page loads fine, but nothing happens when I enter a used id and submit.

The code, from what I can tell, on the formside looks very standard, almost as if it was cut and pasted from a tutorial.


  1. <form id="Form1" method="post" runat="server">
  2. <h3><font face="Verdana">Login Page</font></h3>
  3. <span class="Normal">Company ID:</span> <br>
  4. <input class="NormalTextBox" id="CustomerCode" type="text" name="UserEmail" runat="server">
  5. <ASP:REQUIREDFIELDVALIDATOR id="Requiredfieldvalidator1" runat="server" ErrorMessage="You Must Enter a Valid Company ID." Display="Static" ControlToValidate="CustomerCode" Width="276px" cssclass="NormalRed"></ASP:REQUIREDFIELDVALIDATOR>
  6. <br>
  7. <br>
  8. <ASP:CHECKBOX id="PersistForms" runat="server" autopostback="true" text="Remember me" cssclass="Normal"></ASP:CHECKBOX>
  9. <br>
  10. <br>
  11. <asp:imagebutton id="SigninBtn" runat="server" ImageUrl="~/images/signin.gif"></asp:imagebutton><br>
  12. <asp:label id="Msg" runat="server" cssclass="NormalRed"></asp:label>
  13. </form>

The authentification portion of the web.config reads like this :

  1. <authentication mode="Forms">
  2. <forms loginUrl="login.aspx" name=".ASPXAUTHSC" protection="All" timeout="60"/>
  3. </authentication>

Finally, the login.aspx.vb is apparently some stock code generated from some code generator...

  1. Imports System.Security
  2. Imports System.Web.Security
  3.  
  4. Public Class Login
  5. Inherits System.Web.UI.Page
  6. Protected WithEvents Requiredfieldvalidator1 As System.Web.UI.WebControls.RequiredFieldValidator
  7. Protected WithEvents PersistForms As System.Web.UI.WebControls.CheckBox
  8. Protected WithEvents Msg As System.Web.UI.WebControls.Label
  9. Protected WithEvents SigninBtn As System.Web.UI.WebControls.ImageButton
  10. Protected WithEvents CustomerCode As System.Web.UI.HtmlControls.HtmlInputText
  11.  
  12. #Region " Web Form Designer Generated Code "
  13.  
  14. 'This call is required by the Web Form Designer.
  15. <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  16.  
  17. End Sub
  18.  
  19. Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
  20. 'CODEGEN: This method call is required by the Web Form Designer
  21. 'Do not modify it using the code editor.
  22. InitializeComponent()
  23. End Sub
  24.  
  25. #End Region
  26.  
  27. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  28. 'Put user code to initialize the page here
  29. End Sub
  30.  
  31. Public Sub Login_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles SigninBtn.Click
  32. Dim security As New ASPNetPortal.UsersDB()
  33.  
  34. Dim userId As String = security.Login(CustomerCode.Value.ToString())
  35.  
  36. If Not (userId Is Nothing) And userId <> "" Then
  37. FormsAuthentication.RedirectFromLoginPage _
  38. (userId, PersistForms.Checked)
  39. Else
  40.  
  41. Msg.Text = "<" & "br" & ">Login Failed!" & "<" & "br" & ">"
  42.  
  43. End If
  44.  
  45.  
  46.  
  47. End Sub
  48.  
  49.  
  50.  
  51. End Class

I know enough about this to get myself into a heap of trouble, and im probably looking in the wrong place. For all I know it could be a browser issue for end users who dont have the right browser version or .net version running. I dont know.

Any help would be appreciated, if you need more info feel free to let me know!


Mike E
Assistant Manager, Pharmacy Informatics
Wordpress Learning Blog
Updated : ASP.Net Login Code
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 6
Reputation: Sycophant is an unknown quantity at this point 
Solved Threads: 0
Sycophant Sycophant is offline Offline
Newbie Poster

Re: login working in IE but not mozilla?

 
0
  #3
Jun 17th, 2005
Hoowah, now I just have to figure out what its supposed to do OnClick and put all that goodness in there!

me™
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 6
Reputation: Sycophant is an unknown quantity at this point 
Solved Threads: 0
Sycophant Sycophant is offline Offline
Newbie Poster

Re: login working in IE but not mozilla?

 
0
  #4
Jun 17th, 2005
So this code doesn't handle the process? I'm so lost


  1. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  2. 'Put user code to initialize the page here
  3. End Sub
  4.  
  5. Public Sub Login_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles SigninBtn.Click
  6. Dim security As New ASPNetPortal.UsersDB()
  7.  
  8. Dim userId As String = security.Login(CustomerCode.Value.ToString())
  9.  
  10. If Not (userId Is Nothing) And userId <> "" Then
  11. FormsAuthentication.RedirectFromLoginPage _
  12. (userId, PersistForms.Checked)
  13. Else
  14.  
  15. Msg.Text = "<" & "br" & ">Login Failed!" & "<" & "br" & ">"
  16.  
  17. End If
  18.  
  19.  
  20.  
  21. End Sub
  22.  
  23.  
  24.  
  25. End Class
  26.  

If I am reading you correctly, I need an HTML side On_Click function assigned to that particular line of code....

I should stick to static web pages

Mike E
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 175
Reputation: Letscode is an unknown quantity at this point 
Solved Threads: 6
Letscode's Avatar
Letscode Letscode is offline Offline
Junior Poster

Re: login working in IE but not mozilla?

 
0
  #5
Jun 17th, 2005
Mike,
What Paladine is saying is ..there is no connection between your VB code and your HTML designer code..(meaning there is no way of event to be tiggered when you click the image button)

To solve:
1.Double click the SigninBtn(image) button and place this code
[CODE]
Dim security As New ASPNetPortal.UsersDB()

Dim userId As String = security.Login(CustomerCode.Value.ToString())

If Not (userId Is Nothing) And userId <> "" Then
FormsAuthentication.RedirectFromLoginPage _
(userId, PersistForms.Checked)
Else

Msg.Text = "<" & "br" & ">Login Failed!" & "<" & "br" & ">"

End If
[\CODE]
Save White Tiger
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 6
Reputation: Sycophant is an unknown quantity at this point 
Solved Threads: 0
Sycophant Sycophant is offline Offline
Newbie Poster

Re: login working in IE but not mozilla?

 
0
  #6
Jun 17th, 2005
here is where I am confused...

At the top of my login.aspx page (the html page) this code appears
  1. <%@ Page Language="vb" AutoEventWireup="false" Codebehind="login.aspx.vb" Inherits="databasename.Login"%>

In the login.aspx.vb

  1. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  2. 'Put user code to initialize the page here
  3. End Sub
  4.  
  5. Public Sub Login_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles SigninBtn.Click
  6. Dim security As New ASPNetPortal.UsersDB()
  7.  
  8. Dim userId As String = security.Login(CustomerCode.Value.ToString())
  9.  
  10. If Not (userId Is Nothing) And userId <> "" Then
  11. FormsAuthentication.RedirectFromLoginPage _
  12. (userId, PersistForms.Checked)
  13. Else
  14.  
  15. Msg.Text = "<" & "br" & ">Login Failed!" & "<" & "br" & ">"
  16.  
  17. End If
  18.  

This is what is there. Im drawing the conclusion that the
  1. Public Sub Login_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles SigninBtn.Click
  2. Dim security As New ASPNetPortal.UsersDB()
  3.  
  4. Dim userId As String = security.Login(CustomerCode.Value.ToString())
  5.  
  6. If Not (userId Is Nothing) And userId <> "" Then
  7. FormsAuthentication.RedirectFromLoginPage _
  8. (userId, PersistForms.Checked)
  9. Else
  10.  
  11. Msg.Text = "<" & "br" & ">Login Failed!" & "<" & "br" & ">"
  12.  
  13. End If

should handle the actual On_Click...


Im getting and parsing all of this in dreamweaver so i'm not really sure how double clicking an image will let me fill in the code that operates the image.

Like I said, this is a mess I am in and I appreciate the feedback, eventually I will get this figured out and hopefully be able to learn this

Mike
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 6
Reputation: Sycophant is an unknown quantity at this point 
Solved Threads: 0
Sycophant Sycophant is offline Offline
Newbie Poster

Re: login working in IE but not mozilla?

 
0
  #7
Jun 17th, 2005
NEW INFO - client is telling me that this worked until recently - in IE and mozilla, which leads me to wonder if an update to IE has changed something..

Any ideas?

Me™
Reply With Quote Quick reply to this message  
Join Date: Feb 2003
Posts: 793
Reputation: Paladine has a spectacular aura about Paladine has a spectacular aura about Paladine has a spectacular aura about 
Solved Threads: 26
Team Colleague
Paladine's Avatar
Paladine Paladine is offline Offline
Master Poster

Re: login working in IE but not mozilla?

 
0
  #8
Jun 17th, 2005
Ok, no update would change this. The code got changed. Period!

The VB Code for Login_Click event (see your code below) is not tied to anything on the HTML side that would activate it. (Make sense?)

So you have to associate that code to a control (from the HTML) side inorder for the event to fire. So do this:

As LetsCode stated:

1. Double Click on the SignIn Image Button (in Design view of the HTML code) to create the event SignIn_Click on the VB Code side.
2. Then copy and paste the code from Login_Click event into the newly created SignIn_Click event. **NOTE** DO NOT Copy and paste the code I am giving you to show you the result, actually do the process I have described

Result would be:
Public Sub SigninBtn_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles SigninBtn.Click
 Dim security As New ASPNetPortal.UsersDB()

        Dim userId As String = security.Login(CustomerCode.Value.ToString())

        If Not (userId Is Nothing) And userId <> "" Then
            FormsAuthentication.RedirectFromLoginPage _
                               (userId, PersistForms.Checked)
        Else

            Msg.Text = "<" & "br" & ">Login Failed!" & "<" & "br" & ">"

        End If
End Sub


make sense I hope?



Your POST:
Originally Posted by Sycophant
here is where I am confused...

At the top of my login.aspx page (the html page) this code appears
  1. <%@ Page Language="vb" AutoEventWireup="false" Codebehind="login.aspx.vb" Inherits="databasename.Login"%>

In the login.aspx.vb

  1. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  2. 'Put user code to initialize the page here
  3. End Sub
  4.  
  5. Public Sub Login_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles SigninBtn.Click
  6. Dim security As New ASPNetPortal.UsersDB()
  7.  
  8. Dim userId As String = security.Login(CustomerCode.Value.ToString())
  9.  
  10. If Not (userId Is Nothing) And userId <> "" Then
  11. FormsAuthentication.RedirectFromLoginPage _
  12. (userId, PersistForms.Checked)
  13. Else
  14.  
  15. Msg.Text = "<" & "br" & ">Login Failed!" & "<" & "br" & ">"
  16.  
  17. End If
  18.  

This is what is there. Im drawing the conclusion that the
  1. Public Sub Login_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles SigninBtn.Click
  2. Dim security As New ASPNetPortal.UsersDB()
  3.  
  4. Dim userId As String = security.Login(CustomerCode.Value.ToString())
  5.  
  6. If Not (userId Is Nothing) And userId <> "" Then
  7. FormsAuthentication.RedirectFromLoginPage _
  8. (userId, PersistForms.Checked)
  9. Else
  10.  
  11. Msg.Text = "<" & "br" & ">Login Failed!" & "<" & "br" & ">"
  12.  
  13. End If

should handle the actual On_Click...


Im getting and parsing all of this in dreamweaver so i'm not really sure how double clicking an image will let me fill in the code that operates the image.

Like I said, this is a mess I am in and I appreciate the feedback, eventually I will get this figured out and hopefully be able to learn this

Mike
Assistant Manager, Pharmacy Informatics
Wordpress Learning Blog
Updated : ASP.Net Login Code
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 175
Reputation: Letscode is an unknown quantity at this point 
Solved Threads: 6
Letscode's Avatar
Letscode Letscode is offline Offline
Junior Poster

Re: login working in IE but not mozilla?

 
0
  #9
Jun 17th, 2005
Try what Paladine said...

May be it should work...
Save White Tiger
Reply With Quote Quick reply to this message  
Join Date: Feb 2003
Posts: 793
Reputation: Paladine has a spectacular aura about Paladine has a spectacular aura about Paladine has a spectacular aura about 
Solved Threads: 26
Team Colleague
Paladine's Avatar
Paladine Paladine is offline Offline
Master Poster

Re: login working in IE but not mozilla?

 
0
  #10
Jun 17th, 2005
Trust me....

try what I suggested first. Then report back if no change.


Oh, be sure to COMMENT out the Login_Click event (DONT DELETE IT).

Originally Posted by Letscode
Try what Paladine said...

May be it should work...
Assistant Manager, Pharmacy Informatics
Wordpress Learning Blog
Updated : ASP.Net Login Code
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the ASP.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC