Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
i have the following code:

JavaScript
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script  type="text/javascript">
       function goToSignup() {
           $("#register").fadeIn("fast");
           $("#login").fadeOut("fast");
       }
       function goToLogin() {
           $("#login").fadeIn("fast");
           $("#register").fadeOut("fast");
       }
   </script>


that's my asp code:

ASP.NET
   <div id="login" class="animate form">
      <p> 
          <label for="username" class="uname" data-icon="u" > Your username </label>
          <asp:Textbox runat="server" id="username"  name="username" type="text" placeholder="myusername"/>
     </p>
     <p> 
     <label for="password" class="youpasswd" data-icon="p"> Your password </label>
     <asp:Textbox runat="server" id="password"  name="password" type="password" placeholder="eg. X8df!90EO" /> 
     </p>
     <p class="keeplogin"> 
<input type="checkbox" name="loginkeeping" id="loginkeeping" value="loginkeeping" /> 
<label for="loginkeeping">Keep me logged in</label>
   </p>

   </div>

   <div id="register" class="animate form" >
     <p> 
       <label for="usernamesignup" class="uname" data-icon="u">Firstname</label>
      <label for="usernamesignup" class="uname"  style="color: red;">*</label>
         <asp:CustomValidator ID="CustomValidator2" runat="server" Display="Dynamic"
        ValidationGroup="registerGRP" Font-Bold="true" ForeColor="Red" onservervalidate="cusCustom_RegisterValidate"></asp:CustomValidator>
      <asp:Textbox runat="server" id="Firstname" name="usernamesignup" type="text" placeholder="mysuperusername690" />
        </p>
      <p> 
     <label for="usernamesignup" class="uname" data-icon="u">Lastname</label>
     <label for="usernamesignup" class="uname"  style="color: red;">*</label>
      <asp:Textbox runat="server" id="Lastname" name="usernamesignup" type="text" placeholder="mysuperusername690" />
      </p>
       <p> 
       </div>


that's my vb.net code:

VB
    Protected Sub btn_login_Click(sender As Object, e As System.EventArgs) Handles btn_login.Click
    If Session("valid") Then
        ScriptManager.RegisterStartupScript(Me.Page, Me.[GetType](), "foo", "goToLogin()", True)
    End If
End Sub

Protected Sub btn_signup_Click(sender As Object, e As System.EventArgs) Handles btn_signup.Click
    'Dim tbUserName As TextBox = Page.FindControl("username")
    'tbUserName.required = False
    ScriptManager.RegisterStartupScript(Me.Page, Me.[GetType](), "foo", "goToSignup()", True)
End Sub


when i click on the button the div fades out but the other div does not fade in when i inspect my page i get the container but it's invisible in the page

any suggestions?
Posted
Comments
Sergey Alexandrovich Kryukov 20-Sep-13 13:57pm    
Did you try "slow"?
—SA

First, you are using using "fast" so apparently you won't experience any fading, Divs will just show and hide.
Secondly you are trying to do it through server side code. if you don't require any server side processing other than executing those JavaScript functions, I suggest you use Button's OnClientClick to invoke the JavaScript and use return false; after the function call to prevent postback.

Hope it helps.

Azee...
 
Share this answer
 
you you can use some timer or thread to see the visual impact.
 
Share this answer
 

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