views:

79

answers:

2

I have simple code like this... as follow...

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="AlinmaWebApp._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
    <style type="text/css">
        #formHt
        {
            height: 284px;
        }
        .DivStyle
        {
            height :250px;
            background-color :Green ;
            display : block;
        }

    </style>

<script language="javascript" type ="text/javascript" >

    function TryClose() {
        document.getElementById("DivBah").style.height = '1px';
        document.getElementById("DivBah").style.display = 'none';
        return;
    }
</script>


</head>
<body onload="TakeIT() return;" >
    <form id="formHt" runat="server">
    <div id="DivBah" class="DivStyle" >
        Just Try if this part will Collapse or not</div>
    <asp:Button ID="Button1" runat="server" Text="Button" OnClick="TryClose()"/>
    </form>
</body>
</html>

That gave me Error message like => "TryClose" is not a part of "default_._ASPX" What is possible error on this type of coding? Since i always use this type in Simple ASP Program before.

+1  A: 
Galilyou
+1  A: 

Try this :

<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="TryClose()"/>

OnClick used for server side click event.

Canavar