.net - identify whether a button has a class when clicked
I have an asp button which I am using in 2 different places (appending to a new pla开发者_如何学Goce and adding a class using jquery under certain conditions).
I need to slightly alter the function that runs when this button is clicked depending on whether or not this button has a given class. Is this possible??
So something like this...
if myASPButton hasclass("xyz") then
...
end if
i'm using vb.net for what it's worth.
It's not possible, clicking a button causes a postback, the only information posted back is form data. Modifications to the HTML client-side wont be reflected severside.
You will need to make a hidden field and populate the value of the hidden field and use that for checking severside.
精彩评论