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

  • SEARCH
  • Home
  • 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 7904713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T10:11:58+00:00 2026-06-03T10:11:58+00:00

I have server side controls like textbox, dropdownlsit etc on aspx page and my

  • 0

I have server side controls like textbox, dropdownlsit etc on aspx page and my objective is to hide them during page load.

With the below code, the controls are being hidden during page load, but i notice flickering. The desired output should eliminate this control flickering. Any help is greatly appreciated.

var ispostBack =false;
function pageLoad() {
    $(document).ready(function () {
        HideCtrls();
//Some other code here
     }

function HideCtrls()
{
    document.getElementById("cph1_divSear").style.setAttribute('display', '')
    if (document.getElementById("cph1_txtSearch"))
    {
        document.getElementById("cph1_txtSearch").style.setAttribute('display', 'none')
        document.getElementById("cph1_txtkey").style.setAttribute('display', 'none')
        document.getElementById("cph1_hypProjNo").style.setAttribute('display', 'none')
        document.getElementById("cph1_ddlSeaSingle").style.setAttribute('display', 'none')
         document.getElementById("cph1_txtSeaStart").style.setAttribute('display', 'none')
        document.getElementById("cph1_txtSeaEnd").style.setAttribute('display', 'none')
        document.getElementById("cph1_txtSeFLike").style.setAttribute('display', 'none')
        document.getElementById("cph1_imgSeaSt").style.setAttribute('display', 'none')
        document.getElementById("cph1_txtSeTLike").style.setAttribute('display', 'none')
        document.getElementById("cph1_imgSeaEnd").style.setAttribute('display', 'none')
        document.getElementById("cph1_txtPersonnel3").style.setAttribute('display', 'none')
        document.getElementById("cph1_ImageButton3").style.setAttribute('display', 'none')
        document.getElementById("likeFID").style.setAttribute('display', 'none')
        document.getElementById("likeTID").style.setAttribute('display', 'none')
        document.getElementById("dtFID").style.setAttribute('display', 'none')
        document.getElementById("dtTID").style.setAttribute('display', 'none')
    }
}

<div id="divSear" runat="server" class="cols4Search">
                            <span>
                                <asp:TextBox ID="txtSearch" runat="server" Width="350px"></asp:TextBox>
                                <asp:TextBox ID="txtkey" runat="server" onblur="ClearHelp()" onfocus="JavaScript:showhelp('Search_1001')"
                                    Width="400px" MaxLength="150"></asp:TextBox></span> <span style="display: none;">
                                        <asp:HyperLink ID="hypProjNo" runat="server" Target="_blank" ForeColor="Blue">View</asp:HyperLink>
                                    </span><span>
                                        <asp:DropDownList ID="ddlSeaSingle" runat="server" AutoPostBack="True">
                                        </asp:DropDownList>
                                    </span><span id="likeFID">>=<asp:TextBox ID="txtSeFLike" runat="server" MaxLength="9"></asp:TextBox></span>
                            <span id="likeTID"><=<asp:TextBox ID="txtSeTLike" runat="server" MaxLength="9"></asp:TextBox></span>
                            <span id="dtFID">>=<asp:TextBox ID="txtSeaStart" runat="server" Width="85px"></asp:TextBox></span>
                            <span>
                                <asp:ImageButton ID="imgSeaSt" runat="server" CssClass="dateicon" ImageUrl="~/Images/date_icon.png" /></span>
                            <span id="dtTID"><=<asp:TextBox ID="txtSeaEnd" runat="server" Width="85px"></asp:TextBox></span>
                            <span>
                                <asp:ImageButton ID="imgSeaEnd" runat="server" CssClass="dateicon" ImageUrl="~/Images/date_icon.png" /></span>
                            <span>
                                <asp:TextBox ID="txtPersonnel3" runat="server" CssClass="textbox" onblur="ClearHelp()"
                                    Width="160px" onfocus="JavaScript:showhelp('AdminUserDetails_1001')"></asp:TextBox></span>
                            <span>
                                <asp:ImageButton ID="ImageButton3" runat="server" ImageUrl="~/Images/searchtool.png"
                                    ToolTip="Select User" CssClass="iconalign" /></span>
                            <br />
                            <asp:Label ID="lblNote" Visible="false" CssClass="Notelabel" runat="server" />
                        </div>
  • 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-03T10:12:00+00:00Added an answer on June 3, 2026 at 10:12 am

    Hide all the controls on server, show them on client when required this way you will not have the problem of hiding controls after being shown for while

    In HTML

     <asp:TextBox ID="txtSearch" style="display:none" Visible="False" Width="350px"></asp:TextBox> 
    

    or In Code Behind

     txtSearch.Attributes.Add("style", "display:none"); = "false";
    

    and Show them in javascript when required

    if (document.getElementById("cph1_txtSearch"))
    {
        document.getElementById("cph1_txtSearch").style.setAttribute('display', 'block')
        //Similarly you can show all field which are required to be shown
        // .........
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that we have client side controls and we have server side controls.
I have a situation where I want to use several server side controls, which
I currently have a control that is being hidden on my server side using
I have a chrome extension which have a server-side javascript and I need this
I have an expensive server side resource ( which is thread safe ). What
If I have pages having server-side code in code-behind, then I know that the
What tools for server side application performance testing you suggest? Have an application server
It's Friday afternoon and my brain is fried. I have a unique server side
I have a the following server side app.config for a WCF service: <system.serviceModel> <bindings>
I have created an application server side that will create a pdf of a

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.