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:

iPhone Launch Screen Sizes

iPhone Portrait iOS 8 Retina HT 5.5 = 1242 X 2208 Retna HD 4.7 = 750 X 1134 iPhone Landscape iOS 8 Retina HD 5.5  2208 X 1242 iPho...