Click here to Skip to main content
14,240,836 members
Rate this:
Please Sign up or sign in to vote.
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

Rate this:
Please Sign up or sign in to vote.

Solution 1

Use javascript or server side event for it
see below snippet

<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
   
v2

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100