Click here to Skip to main content
15,898,538 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have two buttons..

1.Login
2.logout

clicking login button logout button enable and login disable
after clicking logout button login enable and logout disable..

here those button's are working only once in a day..

What I have tried:

i have two buttons..

1.Login
2.logout

clicking login button logout button enable and login disable
after clicking logout button login enable and logout disable..

here those button's are working only once in a day..
Posted
Updated 25-May-16 22:47pm
Comments
F-ES Sitecore 26-May-16 5:16am    
You'll need to post the relevant code.

1 solution

Use javascript or server side event for it
see below snippet

JavaScript
<script labguage="javascript">
function enableDisable(objID)
{
  //check if login is clicked then make logout disable
  if (objID == "btnLogin")
  {
     document.getElementById("btnLogin").disabled = true;
     document.getElementById("btnLogout").disabled = false;
  }
  else //if logout clicked
  {
     document.getElementById("btnLogin").disabled = false;
     document.getElementById("btnLogout").disabled = true;
  }

}
</script>
//call above javascript function on button click
<asp:button runat="server" id="btnLogin" text="Login" onclientclick="return enableDisable(this.id)"  />
<asp:button runat="server" id="btnLogout" text="Login" onclientclick="return enableDisable(this.id)"  />

hope it helps
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900