Tuesday, July 20, 2010

How to perform a postback using JavaScript - Asp.net

<%@ Page Language="C#" %>
<html>
<head id="Head1" runat="server">
    <title></title>
    <style>
        .Hide { display:none; }
    </style>
    <script runat="server">
        protected void DoSomething(object sedner, EventArgs e)
        {
            Response.Write(DateTime.Now.ToString("hh:mm:ss"));
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:Button runat="server" ID="btnHidden" CssClass="Hide" 
            UseSubmitBehavior="false" OnClick="DoSomething" />      
 
        <a href="javascript:__doPostBack('<%=btnHidden.UniqueID %>', '')">Invoke Button</a>
    </form>
</body>
</html>

No comments:

Azure Storage Account Types

Defferent Types of Blobs Block blobs store text and binary data. Block blobs are made up of blocks of data that can be managed individually...