yosh
yosh

Reputation: 178

VB.NET Events aren't working or displaying info?

I am currently attempting to query my database to link it to my login screen. So when you enter a password for the login to say "invalid user" etc.

But, I go to set the button_click function, and in the Events, I could not find button1, only found page load, even though I right clicked and went to properties on the button. It only displayed a blank drop down and something called PageLoad. Can anyone help with this issue?

Snippet:

 <p class="submitButton">
                    <asp:Button ID="button1" runat="server" CommandName="Login" Text="Log In" 
                        ValidationGroup="LoginUserValidationGroup" onclick="Page_Load"/>
                </p>

Public Class Login

    Inherits System.Web.UI.Page


    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        RegisterHyperLink.NavigateUrl = "Register.aspx?ReturnUrl=" + HttpUtility.UrlEncode(Request.QueryString("ReturnUrl"))

    End Sub



End Class

See image here.

Upvotes: 0

Views: 68

Answers (1)

jojo
jojo

Reputation: 56

Remove onclick="Page_Load" ,

Try to add a click handler manually like this

Protected Sub button1_Click(sender as Object, e as System.EventArgs) Handles button1.Click

End Sub

Upvotes: 1

Related Questions