?
Solved

ASP.NET  How to hide a button from view

Posted on 2014-03-28
8
Medium Priority
?
661 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 29

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
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 
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
 
LVL 29

Assisted Solution

by:becraig
becraig earned 800 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 29

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 1200 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

764 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