Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Asp.net×Ô¶¨ÒåÑéÖ¤¿Ø¼þCustomValidator µÄʹÓ÷½·¨

javascript º¯Êý ºÍ CustomValidator¿Ø¼þÏà½áºÏʹÓÃ
<asp:TextBox ID="txtPwdPrompt" runat="server"></asp:TextBox>
<asp:CustomValidator id="CVPwdPrompt" runat="server" ClientValidationFunction="CheckPwd" ControlToValidate="txtPwdPrompt" ErrorMessage="<span style='font:12px'>ÌáʾÎÊÌâ±ØÐëÔÚ2-50¸ö×Ö·ûÄÚ</span>" Display="None"></asp:CustomValidator>
Javascriptº¯Êý:
<script language="javascript" type="text/javascript">
function CheckPwd(source, arguments)
{
   if(arguments.Value.Length>2 || arguments.Value.Length < 50)
   {
     arguments.IsValid=true;
   }
   else
   {
     arguments.IsValid =false;
   }
}
</script>
º¯ÊýÓÐÁ½¸ö²ÎÊý:
source ²ÎÊýÊǶÔΪ CustomValidator ¿Ø¼þ³ÊÏÖµÄ <span> ÔªËصÄÒýÓá£Òò´Ë£¬Äú¿ÉÒÔ±à³ÌµÄ·½Ê½¿ØÖÆ <span> ±ê¼Ç£¬ÈçÐÞ¸Ä InnerHtml ÊôÐÔ¡£
arguments ²ÎÊýÊÇÒ»¸ö¾ßÓÐÒÔÏÂÁ½¸öÊôÐԵĶÔÏó£ºValue ºÍ IsValid¡£Ê¹Óô˲ÎÊý¿ÉÒÔ»ñÈ¡¿Ø¼þµÄÖµ£¬ÒÔ¸ù¾Ý×Ô¶¨ÒåÑéÖ¤Àý³ÌÑéÖ¤²¢Ö¸Ê¾¸ÃÖµÊÇ·ñÓÐЧ¡£
      ʹÓà ClientValidationFunction ÊôÐÔÖ¸¶¨Óë CustomValidator ¿Ø¼þ¹ØÁªµÄ¿Í»§¶ËÑéÖ¤½Å±¾º¯ÊýµÄÃû³Æ¡£ÓÉÓڸýű¾º¯ÊýÔÚ¿Í»§¶ËÖ´ÐУ¬Òò´Ë¸Ãº¯Êý±ØÐëʹÓÃÄ¿±êä¯ÀÀÆ÷Ö§³ÖµÄÓïÑÔ£¨Èç VBScript »ò JScript£©À´±àд¡£
Óë·þÎñÆ÷¶ËÑéÖ¤Ò»Ñù£¬¿ÉÒÔͨ¹ýʹÓà arguments ²ÎÊýµÄ Value ÊôÐÔÀ´·ÃÎÊÒªÑéÖ¤µÄÊäÈë¿Ø¼þÖеÄ×Ö·û´®¡£Í¨¹ýÉèÖà arguments ²ÎÊýµÄ IsValid ÊôÐÔ·µ»ØÑéÖ¤½á¹û¡£
×¢Òâ:ValueÊ××Öĸ±ØÐë´óд


Ïà¹ØÎĵµ£º

ASP.NET Óë AJAXµÄʵÏÖ·½Ê½

µ½Èí¼þ¹«Ë¾Ñ§IT¼¼Êõhttp://www.tsp2c.cn/
Ajax Ó¦¸Ã²»ÊÇÒ»Ïî¼¼Êõ£¬ÊÇÒ»ÖÖ˼Ïë¶øÒÑ£¬¸ú ASP.NET ÒÔ¼°ÆäËü Web ¿ª·¢ÓïÑÔûÓÐʲô̫´ó¹Øϵ£¬ÕâÀïÖ»ÊÇ̸̸ ASP.NET ÖÐĿǰʹÓÃµÄ Ajax ¼¼ÊõÒÔ¼°ÆäËüһЩʵÏÖ Ajax µÄÓÅÐã¿ò¼Ü¡£
¡¡¡¡Ajax ÒѾ­ºÜÁ÷ÐÐÒ»Õó×ÓÁË£¬ÏÖÔÚ̸ Ajax ¾õµÃÓеãÀÏÍÁ¡£Ä¿Ç°ËùνµÄ Web2.0 ÍøÕ¾£¬»ù±¾ÉÏûÓв» ......

ASP.NETÖдæȡͼƬµ½Êý¾Ý¿âµÄʾÀý

//¿ª·¢»·¾³£ºWindow 2000¡¢SQLServer2000¡¢.Net Framework SDKÕýʽ°æ
//¿ª·¢ÓïÑÔ£ºC#¡¢ASP.Net
//¼ò½é£ºÊý¾Ý¿âÖÐͼƬ´æÐî¼°¶ÁÈ¡
//×÷Õߣºengine
/*
˵Ã÷£ºÔÚASPÖУ¬ÎÒÃÇÓÃRequest.TotalBytes¡¢Request.BinaryRead()À´ÉÏ´«Í¼Æ¬£¬Õâ¸ö¿É¶ñµÄBinaryRead()·½·¨·Ç³£±¿£¬µ¥¸öÎļþÉÏ´«µ¹Ã»Ê²Ã´´óÊ£¬µ¥Èç¹û¶à¸öͼƬÉÏר¿É¾Í»¨ ......

ASP.NETÖÐIfameµÄʹÓÃ

 Iframe±ê¼Ç£¬Óֽи¡¶¯Ö¡±ê¼Ç£¬Äã¿ÉÒÔÓÃËü½«Ò»¸öHTMLÎĵµÇ¶ÈëÔÚÒ»¸öHTMLÖÐÏÔʾ¡£Ëü²»Í¬ÓÚFrame±ê¼Ç×î´óµÄÌØÕ÷¼´Õâ¸ö±ê¼ÇËùÒýÓõÄHTMLÎļþ²»ÊÇÓëÁíÍâµÄHTMLÎļþÏ໥¶ÀÁ¢ÏÔʾ£¬¶øÊÇ¿ÉÒÔÖ±½ÓǶÈëÔÚÒ»¸öHTMLÎļþÖУ¬ÓëÕâ¸öHTMLÎļþÄÚÈÝÏ໥Èںϣ¬³ÉΪһ¸öÕûÌ壬ÁíÍ⣬»¹¿ÉÒÔ¶à´ÎÔÚÒ»¸öÒ³ÃæÄÚÏÔʾͬһÄÚÈÝ£¬¶ø²»±ØÖظ´Ð´ÄÚÈ ......

ASP.NET

      HiddenField ¿Ø¼þÌṩÁËÒ»ÖÖÔÚÒ³ÃæÖд洢ÐÅÏ¢µ«²»ÏÔʾÐÅÏ¢µÄ·½·¨¡£ÀýÈ磬¿ÉÒÔÔÚ HiddenField ¿Ø¼þÖд洢Óû§Ê×Ñ¡ÏîÉèÖã¬ÒÔ±ã¿ÉÒÔÔÚ¿Í»§¶Ë½Å±¾ÖжÁÈ¡´ËÉèÖá£ÈôÒª½«ÐÅÏ¢·ÅÈë HiddenField ¿Ø¼þÖУ¬ÇëÔÚÁ½´Î»Ø·¢Ö®¼ä½«Æä Value ÊôÐÔÉèÖÃΪҪ´æ´¢µÄÖµ¡£
 
Ò»¡¢¹¦ÄÜ
¿ÉÒÔʹÓà HiddenFi ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ