JS调用后台方法

html:
<asp:Button ID="Button1" runat="server" Text="Button"  style="display:none;"  onclick="Button1_Click" />
<input id="Button2" type="button" onclick="document.getElementById('Button1').click();"  value="button" />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>

后台:
 protected void Button1_Click(object sender, EventArgs e)
    {
        Label1.Text = DateTime.Now.ToString();
    }
posted on 2009-07-23 15:40  heart-in-sky  阅读(227)  评论(0编辑  收藏  举报