Panel hide and show particular interval time using Javascript in Asp.Net C#

Panel hide and show particular interval 

time using Javascript

Using Javascript particular interval Panel Control hide and show in c#.



                        HTML CODING

<html xmlns="">
<head runat="server">
    <title>Panel hide and show particular interval time using Javascript in Asp.Net C#</title>
    <script type="text/javascript">

        function ShowPanel()
            document.getElementById('<%=Panel1.ClientID%>').style.display = "none";
        setTimeout("ShowPanel();", 2000);

    <form id="form1" runat="server">
    <div align="center">
        <asp:Panel ID="Panel1" Visible="false" runat="server" >
            <asp:Label ID="Label5" runat="server" Text="Register Successfully" Font-Size="XX-Large" ForeColor="#FF3300"></asp:Label>
            <table class="table">

           <tr><td align="center">
             <asp:Label ID="Label4" runat="server" Font-Overline="False" Font-Size="Medium" Text="Name"></asp:Label>
                 <asp:TextBox ID="txtName" placeholder="Full Name" runat="server" Font-Overline="False" Font-Size="Medium"></asp:TextBox>
         <tr><td align="center">
             <asp:Label ID="Label3"  Font-Size="Medium"  runat="server" Text="Email Id"></asp:Label>
             </td><td><asp:TextBox ID="txtEmail"  Font-Size="Medium"  runat="server"></asp:TextBox>
                 <br />
                <br />
      <td colspan="2">
       <asp:Button ID="Btn_Register" runat="server"  Font-Size="Medium"  Text="Register"

                  C# CODING

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Activation_link_ : System.Web.UI.Page
    protected void Page_Load(object sender, EventArgs e)

    protected void Btn_Register_Click(object sender, EventArgs e)
        Panel1.Visible = true;      
        System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Script", " ShowPanel();", true);



First - Add New Webform - add interval time for panel using Javascript

Next - add the button,textbox from toolbox


Next call the javascript function from code behind



Post a Comment