Hello

I am using the following in one Web page form in ASP.NET (VS 2013) in order to 'set focus' on the username field:

 Protected Sub Page_Load(ByVal sender As Object, _
    ByVal e As System.EventArgs)
        username.Focus()
    End Sub

It works on that form, but not on this new one: BC30269: 'Protected Sub Page_Load(sender As Object, e As System.EventArgs)' has multiple definitions with identical signatures:

Protected Sub Page_Load(ByVal sender As Object, _

I am not clear as to why it would work in one form and not another. The only difference is that this new form takes UserName and not username, but I have accounted for that. The error, in particular, is pointing to 'Page_Load'. What OTHER properties, or attributes, then would lead to this error - and how best to get it working?

Thank you.

I am able to replicate this error if I enter:

 Protected Sub Page_Load(ByVal sender As Object, _
    ByVal e As System.EventArgs)

End Sub

 Protected Sub Page_Load(ByVal sender As Object, _
    ByVal e As System.EventArgs)

End Sub

In the above code this error occured because it is defined more than once without changing the number of parameters.

Edited 2 Years Ago by cgeier

Hello cgeier

Thank you for your reply.

Do you mean because I have duplicated 'Sub Page_Load'? (please see attached).

In which way is it best to change the number of parameters?

Thank you for your patience.

Blueie

Attachments Sub_page_Load.jpg 36.49 KB Sub_page_Load.jpg 36.49 KB

Thank you, cgeier.

I'll watch out for that in the future.

Regards

This article has been dead for over six months. Start a new discussion instead.