| 发表于:2007-02-14 00:23:464楼 得分:0 |
<%@ page language= "c# " autoeventwireup= "true " %> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en " "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd "> <html xmlns= "http://www.w3.org/1999/xhtml "> <head> <meta http-equiv= "content-type " content= "text/html; charset=utf-8 " /> <title> shawl.qiu template </title> <script runat= "server "> void btn_clk(object s, eventargs e) { if(page.isvalid&&tbx.text!= " ") { lbl.text= "field valid. "; } else { lbl.text= "field invalid. "; } } // end page_load </script> </head> <body> <form runat= "server "> <asp:label id= "lbl " runat= "server " /> <li/> <asp:textbox id= "tbx " runat= "server " /> <li/> <asp:button runat= "server " onclick= "btn_clk " text= "go validate " /> <asp:requiredfieldvalidator runat= "server " controltovalidate= "tbx " /> </form> </body> </html> | | |
|