Open Close Div tags

Karthikreddy
Posted by Karthikreddy under ASP.NET category on | Points: 40 | Views : 881
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Default4.aspx.cs" Inherits="Default4" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<p>
<script type="text/javascript">
function showElement(id) {
document.getElementById(id).style.display = 'block';
}
function hideElement(id) {
document.getElementById(id).style.display = 'none';
}
</script>


<%--<a href="#" runat="server" onclick="divOpen('login')"> Login</a>--%>
<a href="javascript:;"
onclick="showElement('login'),hideElement('reg')" >
Login
</a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="javascript:;" onclick="showElement('reg'),hideElement('login')" >
Register
</a>

</p>
<div id="login" style="display:none;">
<asp:Label ID="EmailId" runat="server" Text="Email Id"></asp:Label>:<asp:TextBox ID="TxtEmail" runat="server"></asp:TextBox><br />
<asp:Label ID="password" runat="server" Text="Password"></asp:Label><asp:TextBox ID="txtpsw" runat="server"></asp:TextBox>


</div>
<div id="reg" style="display:none;">
<asp:Label ID="UserName" runat="server" Text="User Name"></asp:Label><asp:TextBox ID="RTxtUserName" runat="server"></asp:TextBox><br />
<asp:Label ID="RPassword" runat="server" Text="Password"><asp:TextBox ID="RTxtpsw" runat="server"></asp:TextBox></asp:Label><br />
<asp:Label ID="REmailID" runat="server" Text="Email Id"></asp:Label><asp:TextBox ID="RtxtEmail" runat="server"></asp:TextBox><br />
<asp:Button ID="Register" runat="server" Text="Register" />


</div>
</asp:Content>

Comments or Responses

Login to post response