Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ASP.NET  How to hide a button from view

Posted on 2014-03-28
8
Medium Priority
?
687 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
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 embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

610 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