Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi, I use a css style for buttons, how can I call Sub or function after click on this button? (buttonman). I tried call image button which now I use on click method, but not function. Or how can I call
GridView7.BorderColor = Color.Tomato
after click on button "butonman"?. Thank you

aspx:

<button class="buttonman" type="button" style="vertical-align:middle; position: absolute;left: 10px;"> <span>Management </span>


VB sub:
Protected Sub ImageButton1_Click(sender As Object, e As ImageClickEventArgs) Handles
GridView7.BorderColor = Color.Tomato
End Sub


CSS:

.buttonman {
    border-style: none;
    border-color: inherit;
    border-width: 1px;
    display: inline-block;
    border-radius: 4px;
    background-color: #f4511e;
    color: #FFFFFF;
    text-align: center;
    font-size: 26px;
    width: 230px;
    padding: 15px;
    transition: all 0.5s;
    cursor: pointer;
    margin: 5px;
    top: 280px;
}

    .buttonman span {
        cursor: pointer;
        display: inline-block;
        position: relative;
        transition: 0.5s;
   
}

        .buttonman span:after {
            content: '\00bb';
            position: relative;
            opacity: 0;
            top: 0;
            right: -20px;
            transition: 0.5s;
        }

    .buttonman:hover span {
        padding-right: 25px;
    }

        .buttonman:hover span:after {
            opacity: 1;
            right: 0;
        }


What I have tried:

I tried to

Protected Sub ImageButton1_Click(sender As Object, e As ImageClickEventArgs) Handles buttonman.click
but not support.

and:

I tried script:
<button class="buttonman" type="button" style="vertical-align:middle; position: absolute;left: 10px;">
<span>Management </span>

<script>                                            document.getElementById('ImageButton1').click();
</script>
Posted
Updated 3-Jan-22 3:47am
v4
Comments
Maciej Los 3-Jan-22 15:19pm    
Where the VBA code is placed?
Member 15251555 4-Jan-22 1:33am    
here is my structure if is it what you want: https://imageupload.io/i/b9PNSZoMmB
CHill60 4-Jan-22 8:12am    
Many of us cannot access that link from work. Also use the "Reply" link if you want to reply to a comment.
I suspect you don't mean VBA at all VBA = "Visual Basic For Applications" and is used in Microsoft Office products not ASP
Member 15251555 4-Jan-22 1:40am    
I cant use handles "button".click I dont known how can I call sub from this button where is only styles i StyleSheet.css

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900