1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | aspx: <form id="form1" runat="server"> <div> <input name="TextBox1" type="text" /> <asp:Button ID="Search" runat="server" OnClick="Search_Click" Text="搜尋" /> </div> </form> cs: protected void Page_Load(object sender, EventArgs e) { wl("Page_Load"); if (IsPostBack) { foreach (var item in Request.Form.AllKeys) { wl(item+":"+Request.Form[item]); } } } protected void Search_Click(object sender, EventArgs e) { wl("Search_Click"); } void wl(string a) { Response.Write(a + "<br />"); } /* enter送出表單結果: Page_Load __VIEWSTATE:/wEPDwUKMjA0OTM4MTAwNGRkLghzRoHNOnf2daA4+x7iECQbZnc= __EVENTVALIDATION:/wEWAgLMrZrVAgKn2pL8CXNlK04N8Ok4vSWMEW5vVqBdfbv2 TextBox1: */ |
Direct link: https://paste.plurk.com/show/640373