Link to home
Start Free TrialLog in
Avatar of karstenweber
karstenweberFlag for United States of America

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.

<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.
}

Open in new window


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!
Avatar of HainKurt
HainKurt
Flag of Canada image

probably it is caused by css...
if you have a test link I can look at it...
Avatar of karstenweber

ASKER

Thanks! I will look for a way to create a test link.
ASKER CERTIFIED SOLUTION
Avatar of karstenweber
karstenweber
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Figured it out...