Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 21, 2012 04:15 PM by ramiramilu
All-Star
95413 Points
14106 Posts
Feb 21, 2012 04:15 PM|LINK
okay..this one working for me -
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title>Untitled Page</title> <script type="text/javascript"> function call() { var ca = document.getElementById('abc'); ca.style.display = 'none'; return false; } </script> </head> <body> <form id="form1" runat="server"> <div> <div id="abc" name="div1">This is Rami</div> <asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="return call()" /> </div> </form> </body> </html>
ramiramilu
All-Star
95413 Points
14106 Posts
Re: Web Form Javascript to hide a div not working
Feb 21, 2012 04:15 PM|LINK
okay..this one working for me -
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title>Untitled Page</title> <script type="text/javascript"> function call() { var ca = document.getElementById('abc'); ca.style.display = 'none'; return false; } </script> </head> <body> <form id="form1" runat="server"> <div> <div id="abc" name="div1">This is Rami</div> <asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="return call()" /> </div> </form> </body> </html>JumpStart