I am working on an ASPX Page.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %>
<!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 runat="server">
<title></title>
<script src="Scripts/jquery-1.4.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#html-Button").click(function() {
$(".someClass").show();
});
$("#<%= btn.ClientID %>").click(function() {
$(".someClass").show();
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div style="visibility:hidden" class="someClass">blabla</div>
<input id="html-Button" type="button" value="Click Me" />
<asp:Button runat="server" ID="btn" Text="Click Me" OnClientClick="return false;" />
</form>
</body>
</html>
Here are the issues I am encountering:
The
visible="false"
attribute in the<div>
is not working as expected, and I need to use the style attribute instead.The script with
.show()
function does not work for either button. However, using.hide()
with a visible div functions properly.