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.

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

Sorry, I've sent that image twice in error.

Page_Load is an event handler. It shouldn't be defined more than once.

Thank you, cgeier.

I'll watch out for that in the future.

Regards

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.