Solved

ASP.NET  How to hide a button from view

Posted on 2014-03-28
8
572 Views
Last Modified: 2014-03-28
Hi.. I have hidden button that I click using JS.
The button appears to the user. I can't seem to hide it from the page.
Any ideas?
thx

     <asp:Button ID="HiddenButton" Text="" Style="display: none;"  OnClick="btnHidden_Click" runat="server" BackColor="Transparent" Width="0px" />
0
Comment
Question by:JElster
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 28

Expert Comment

by:becraig
ID: 39962166
Try this:

     <asp:Button ID="HiddenButton" Text="" Style="display: none;background: transparent; border: none !important; font-size:0;"  OnClick="btnHidden_Click" runat="server"  />
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 39962172
The "display:none;" part should work fine. Maybe you have another style, or some script, that is overriding it.
0
 
LVL 1

Author Comment

by:JElster
ID: 39962602
Still shows a thin line?
0
 
LVL 26

Expert Comment

by:Alan Warren
ID: 39962732
Hi JElster,
Had a similar issue recently with a textbox, that I wanted to populate with a minimum date value, for a compare validator, couldn't set visible="false" or Ajax couldn't find the ControlToCompare hmmm, ended up bludgeoning it into submission like this:
<asp:TextBox ID="MinPickupDateTextBox" runat="server" Text='<%#Eval("minPickupDate")%>'  width="0px" Height="0px" BorderStyle="None" BackColor="Transparent" BorderColor="Transparent"/>

Open in new window

Respectfully yours,
Alan
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 28

Assisted Solution

by:becraig
becraig earned 200 total points
ID: 39962755
<asp:Button ID="HiddenButton" Text="" Style="display: none;background: transparent; border: none !important; font-size:0;border:0px"  OnClick="btnHidden_Click" runat="server"  />
0
 
LVL 1

Author Comment

by:JElster
ID: 39962785
Both show small boxes??????????????
0
 
LVL 28

Expert Comment

by:becraig
ID: 39962808
I am guessing
<asp:Button ID="HiddenButton" Text=""  Visible="false"  OnClick="btnHidden_Click" runat="server"  />


will not do what you need  ?
0
 
LVL 26

Accepted Solution

by:
Alan Warren earned 300 total points
ID: 39962963
Hi JElster,

Try isolating the issue, create a new page, one that doesn't inherit a masterpage or any site themes or styles, paste the samples provided and see if the issue persists. If successful, try loading your previous page in another browser, one that hasn't cached your existing pages, it may be a cache issue. If still no joy, I'd suspect some CSS in the site.css that is appyling style to input { } elements, possibly box-shadow, or outline or some such thing.

Respecfully yours,
Alan
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now