Daniel_Kamel
Daniel_Kamel

Reputation: 619

What does "event handled in markup" mean?

I ran into a problem after one of my function in VB.Net was not executing nor was it giving me an error, and someone recommended me to check if "The server-side event is handled both in markup and in code behind" Could anyone please explain what does server-side event handled in markup mean please, couldn't find anything about it on google.

Upvotes: 0

Views: 30

Answers (1)

Gabe
Gabe

Reputation: 965

They may have been referring to how the event handler is bound to a control. In markup you can specify the event as a property on the control:

<asp:Button ID="btnSubmit" runat="server" OnClick="btnSubmit_Click" Text="Submit" />

But you can also use the Handles keyword in code behind to bind to the control:

Protected Sub btnSubmit_Click(sender As Object, e As EventArgs) Handles btnSubmit.Click

Having them both set can have unforeseen problems.

Upvotes: 1

Related Questions