karstenweber
asked on
Event handler not called when clicking on icon inside button
Greetings Experts,
Background:
ASP.NET 4.6.1
C#
Material-Components-Web (to add Material Design to page)
I'm trying to use Material-Components-Web in an ASP.NET Forms project. The following code shows an icon inside a button.
If I click near the edge of the button it works and the event handler in code behind gets called.
However, if I click directly on the icon, then the even handler is not called.
Question: What's the right way to get the button to call the event handler even if it is the child icon that is clicked?
Thanks!
Background:
ASP.NET 4.6.1
C#
Material-Components-Web (to add Material Design to page)
I'm trying to use Material-Components-Web in an ASP.NET Forms project. The following code shows an icon inside a button.
<button type="submit" name="ctl00$maincontent$btnRefresh" id="maincontent_btnRefresh" class="mdc-fab mdc-fab--mini lexbe-fab">
<i class="material-icons"> refresh</i>
</button>
protected void btnRefresh_Click(object sender, System.EventArgs e)
{
// Called.
}
If I click near the edge of the button it works and the event handler in code behind gets called.
However, if I click directly on the icon, then the even handler is not called.
Question: What's the right way to get the button to call the event handler even if it is the child icon that is clicked?
Thanks!
ASKER
Thanks! I will look for a way to create a test link.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Figured it out...
if you have a test link I can look at it...