Modify JavaScript Code to hide display asp:panel

I found this code on the web and was wondering if anyone can modify it so that i makes visible or hides a asp:panel and also works in Firefox.

This is what i need to show or hide


<asp:Panel ID="pnlUpoadingVideo" EnableViewState="false" runat="server">
     <img alt="" src="../App_Themes/ForumLayout/Images/progressbar_long_green.gif" /><br />
                      Uploading, Please wait.....


public static void PrintProgressBar()

        StringBuilder sb = new StringBuilder();

        sb.Append("<div id='updiv' style='Font-weight:bold;font-size:11pt;Left:320px;COLOR:black;font-family:verdana;Position:absolute;Top:140px;Text-Align:center;'>");

        sb.Append("&nbsp;<script> var up_div=document.getElementById('updiv');up_div.innerText='';</script>");

        sb.Append("<script language=javascript>");

        sb.Append("var dts=0; var dtmax=10;");

        sb.Append("function ShowWait(){var output;output='Please wait while uploading!';dts++;if(dts>=dtmax)dts=1;");

        sb.Append("for(var x=0;x < dts; x++){output+='';}up_div.innerText=output;'red';}");

        sb.Append("function StartShowWait(){'visible';ShowWait();window.setInterval('ShowWait()',100);}");




    //Javascript function to clear progressbar

    public static void ClearProgressBar()

        StringBuilder sbc = new StringBuilder();

        sbc.Append("<script language='javascript'>");

        sbc.Append("alert('Upload process completed successfully!');");






Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Michel PlungjanIT ExpertCommented:
I added
function StopShowWait(){'hidden';clearInterval(tId);'visible'; }

to this:

<div id='updiv' style='Font-weight:bold;font-size:11pt;Left:320px;COLOR:black;font-family:verdana;Position:absolute;Top:140px;Text-Align:center;'></div>
var tId = ''; 
var pnlUpoadingVideo = document.getElementById('pnlUpoadingVideo');//please check the html for the real ID
var up_div=document.getElementById('updiv');up_div.innerText='';
var dts=0; var dtmax=10;
function ShowWait(){var output;output='Please wait while uploading!';dts++;if(dts>=dtmax)dts=1;
for(var x=0;x < dts; x++){output+='';}up_div.innerText=output;'red';}
function StartShowWait(){'visible';ShowWait();tId=window.setInterval('ShowWait()',100);}
function StopShowWait(){'hidden';clearInterval(tId);}

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Michel PlungjanIT ExpertCommented:
giving a

public static void ClearProgressBar() {
  StringBuilder sbc = new StringBuilder();
  sbc.Append("<script language='javascript'>");

Open in new window

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.