Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8311571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:51:33+00:00 2026-06-08T19:51:33+00:00

on markup page, we have these buttons hidden: <asp:TextBox ID=searchBox runat=server></asp:TextBox><asp:Button ID=btnSearch runat=server Text=Search

  • 0

on markup page, we have these buttons hidden:

   <asp:TextBox ID="searchBox" runat="server"></asp:TextBox><asp:Button ID="btnSearch" runat="server" Text="Search Site" /> 
    <br /><br /> 
   <asp:Button runat="server" ID="checkall" Text="Check All" OnClick="checkall_Click" /> 
   <asp:Button runat="server" ID="uncheckall" Text="Uncheck All" OnClick="uncheckall_Click" />

Our desire is that on page load, hide the checkall and uncheckall buttons.

If the search button is clicked, then make the checkall and uncheckall buttons visible.

So far, my effort isn’t working well.

First on page_load(…) event, I have these:

'make them hidden by default
checkall.Visible = False
unckeckall.Visible = False

Then on btnSearch_click (…) event, I want to make sure that search button is clicked and then make checkall and uncheckall buttons visible.

    If (btnSearch.ID = "btnSearch") Then
        checkall.Visible = True
        unckeckall.Visible = True
    End If

So far, it isn’t working well.

On page load, the checkall and uncheckall buttons are hidden, just like we want.

When a user clicks Search Site, they are visible. That’s good too.

Problem is when I click on checkall to check the checkboxes, the checkall/uncheckall buttons disappear again.

We only want them invisible when search sit button is not clicked.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T19:51:34+00:00Added an answer on June 8, 2026 at 7:51 pm

    Move your initializing code inside a !IsPostBack check:

    if (!IsPostBack)
    {
        checkall.Visible = False;
        unckeckall.Visible = False;
    }
    

    Better yet, remove it from the C# make it declarative:

    <asp:Checkbox ID="checkall" Visible="False" ... />
    


    Edit: Or, in VB:

    If Not IsPostBack Then
        checkall.Visible = False
        unckeckall.Visible = False
    End If
    

    Right? My VB may be a little rusty.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following ASP-Markup: <asp:Button runat=server ID=btnSubmit meta:resourcekey=btnSubmit CssClass=submit OnClick=btnSubmit_Click /> And the
I have a search textbox and two image buttons on a page I created
I have a basic asp.net submit button like so: <asp:Button ID=test runat=server onclick=test_Click />
I have the following markup inside a master page <html xmlns=http://www.w3.org/1999/xhtml > <head runat=server>
I have the following markup: <p class=managebox> <button value=Add page> <img src=page_add.png alt=Add more
I have a web page that uses jquery ajax to grab the table markup
I have a hidden field called Id on the page. I also have 2
I have the following markup on a page and unfortunately I do not have
I have inherited an ASP.NET 1.1 web application. On the page there are various
I have this Jquery: div.find(.CopyIntoNewTownAssociation).button({ icons: { primary: ui-icon-copy, text: false} }); and this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.