Modify JavaScript Code to hide display asp:panel

Hi
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.....
                     
    </asp:Panel>

-----------------------------------------

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;up_div.style.color='red';}");

        sb.Append("function StartShowWait(){up_div.style.visibility='visible';ShowWait();window.setInterval('ShowWait()',100);}");
        sb.Append("StartShowWait();</script>");

        HttpContext.Current.Response.Write(sb.ToString());

        HttpContext.Current.Response.Flush();

        }

    //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!');");

        sbc.Append("up_div.style.visibility='hidden';");

        sbc.Append("history.go(-1)");

        sbc.Append("</script>");

        HttpContext.Current.Response.Write(sbc);

        }

Thanks
George
ImInNeedOfHelpAsked:
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(){up_div.style.visibility='hidden';clearInterval(tId);pnlUpoadingVideo.style.visibility='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>
&nbsp;<script>
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;up_div.style.color='red';}
function StartShowWait(){up_div.style.visibility='visible';ShowWait();tId=window.setInterval('ShowWait()',100);}
function StopShowWait(){up_div.style.visibility='hidden';clearInterval(tId);}
StartShowWait();
</script>

Open in new window

0

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'>");
  sbc.Append("StopShowWait();");
  sbc.Append("</script>");
  HttpContext.Current.Response.Write(sbc);
}

Open in new window

0
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
C#

From novice to tech pro — start learning today.