asp.netÉÏ´«Îļþ¸ñʽÏÞÖÆ
if(MyFile.PostedFile.ContentType != "image/gif"
&& MyFile.PostedFile.ContentType != "image/jpg"
&& MyFile.PostedFile.ContentType != "image/pjpeg"
&& MyFile.PostedFile.ContentType != "image/jpeg")
{
//Ö»ÄÜÊÇͼƬ¸ñʽ
Response.Write("<script>alert('ÄúÒªÉÏ´«µÄÕÕƬ¸ñʽֻÄÜÊÇJPG»òGIF¸ñʽ.');</script>");
return false;
}
×¢Ò»£ºMIMEÊÇÒ»ÖÖ¼¼Êõ¹æ·¶£¬ÆäÖÐÎÄ·ÒëΪ¶àÓÃ;InternetÓʼþÀ©Õ¹(Multipurpose Internet Mail Extensions)£¬Ö÷ÒªÓÃÀ´ÔÚInternet´«Êä¹ý³ÌÖбíʾ²»Í¬±àÂë¸ñʽµÄÎļþ;
¡¡¡¡×¢¶þ£ºÒª»ñÈ¡²»Í¬Îļþ¸ñʽµÄMIME¶¨Ò壬ֻҪÆô¶¯×¢²á±í±à¼Æ÷£¬È»ºóÔÚHKEY_CLASSES_ROOTÏÂÕÒµ½¸úºó׺Ãû¶ÔÓ¦µÄ×¢²á±íÏÈç¹û´æÔÚÎļþ¸ñʽµÄMIME¶¨Ò壬ÔÚÓҲര¿Ú¾Í»áÏÔʾһ¸öÃûΪ“Content Type”µÄ¼ü£¬¶øÕâ¸ö¼üµÄÖµ¾ÍÊÇÎļþ¸ñʽµÄMIME¶¨Òå¡£
Ïà¹ØÎĵµ£º
ASP.NET Òì³£´¦Àí
ÔÚ
Asp.net
¿ª·¢¹ý³ÌÖУ¬ÎÒÃÇ»áÓöµ½ºÜ¶à
Exception
£¬²»´¦ÀíÕâЩ
Exception
µÄ»°»á³öÏÖºÜÄÑ¿´µÄÒ³Ãæ¡£
»¹ÓÐһЩÎÒÃÇδԤÁϵ½µÄ
Exception
£¬µ±·¢Éú
Exception
ʱ£¬ÎÒÃÇÒ²±ØÐë½øÐмǼ¾ßÌåλÖã¬ÒÔ±ãÎÒÃÇÐÞÕý´íÎó¡£
asp.net
Òì³£´¦ÀíµÄλÖôó¸ÅÓÐÒÔÏÂ
3
¸öµØ·½
1.
³ÌÐòµÄ´úÂë¶ÎÖУ¬ÕâÊÇ× ......
×î½üÑо¿ÁËÒ»ÏÂtreeview£¬·¢ÏÖÓÐÁ½ÖÖʵÏÖÎÞÏÞ¼¶Ê÷µÄ·½·¨£¬ÎÄ×Ö²»Ïë¶àд£¬Ö±ÈëÖ÷Ìâ¡£
ÏÈ¿´¿´Êý¾Ý¿â±íµÄÉè¼Æ£¬Êý¾Ý±íÖ÷Òª°üÀ¨ID£¬Name£¬ParentIDÕâÈýÏÆäÖÐIDÊÇÖ÷¼ü£¬ParentID¶ÔÓ¦½ÚµãµÄ¸¸½Úµã£º
·½·¨Ò»£ºÓõݹé±éÀúÊý¾Ý£¬²¢½«½ÚµãÖð¸öÌí¼Óµ½treeviewÖÐÈ¥¡£
1.ÏȽøÐÐÊý¾Ý¿âÁ¬½ÓºÍÊý¾ÝµÄ¶ÁÈ¡£¬²¢½«¸ù½ÚµãÏÈÌí¼Ó½øtreeview ......
ǰ̨ aspx Îļþ:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="List.aspx.cs" Inherits="List" %>
<!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" >
<he ......
֮ǰÓöµ½Ò»¸öºÜÓôÃƵÄÎÊÌ⣬ ´ó¸Å¾ÍÊÇdagagridÀïÓ¦ÓÃÁËÒ»¸öÐÐÊÇcheckbox£¬ ½á¹ûËÀ»îµãcheck all£¬ submitÒÔºó Response.FormÀïµÄidºÍ FindControlÀïÕÒµ½µÄ²»Ò»ÖÂÁË.
½áÂÛÊÇ:
datagrid °ó¶¨ÒÔºóÔÙÒ²²»Òª¶¯ÁË! ·ñÔò ǰ̨id ÔÙpostback µÄʱºòÊDz»Ò»Ö嵀 ......