I am using a button that has to be invible and should be used by a javascript function.
<asp:Button ID ="btnDummy1" runat="server" Visible ="true" OnClick="btnSubmit1_Click" width="0px" height="0px"/
I cannot keep visible = false as it the javascript will not use invible content in the poage. I havetried to give width=0 and height=0, still it showws up in Chrome. What do you guys think i should do?
Thanks in advance :)
To make the button completely invisible, I set "cursor" to be default, so even when hovering over the button's location, the cursor will never change to a hand.
hide(); document. getElementById('ButtonID'). style.
A pretty clean approach in ASP.Net it give it a "hidden" class:
<asp:Button ID ="btnDummy1" runat="server" CssClass="hidden" />
Then in your stylesheet:
.hidden { display: none; }
If you set it to Visible="False"
then the code will not be executed.
Instead I think you should wrap it in a <div>
and set display:none
via css:
<div style="display: none;">
<asp:Button ID ="btnDummy1" runat="server" OnClick="btnSubmit1_Click" />
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With