一年多前,Insus.NET有写过一篇 《对象失去焦点时自己动提交数据》,那一篇是依赖Linkbutton来做隐藏提交。是否有不用依赖Linkbutton方法呢? 答案是肯定的。
.aspx页只拉一个TextBox控件:
1 <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
2
3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
5 <html xmlns="http://www.w3.org/1999/xhtml">
6 <head runat="server">
7 <title></title>
8 </head>
9 <body>
10 <form id="form1" runat="server">
11 <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
12 </form>
13 </body>
14 </html>
2
3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
5 <html xmlns="http://www.w3.org/1999/xhtml">
6 <head runat="server">
7 <title></title>
8 </head>
9 <body>
10 <form id="form1" runat="server">
11 <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
12 </form>
13 </body>
14 </html>