1. ´ò¿ªÐµĴ°¿Ú²¢´«ËͲÎÊý£º
¡¡¡¡´«ËͲÎÊý£º
response.write("£¼script£¾window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)£¼/script£¾")
¡¡¡¡½ÓÊÕ²ÎÊý£º
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
¡¡¡¡2.Ϊ°´Å¥Ìí¼Ó¶Ô»°¿ò
Button1.Attributes.Add("onclick","return confirm(’È·ÈÏ?’)");
button.attributes.add("onclick","if(confirm(’are you sure...?’)){return true;}else{return false;}")
¡¡¡¡3.ɾ³ý±í¸ñÑ¡¶¨¼Ç¼
int intEmpID = (int)MyDataGrid.DataKeys[e.Item.ItemIndex];
string deleteCmd = "DELETE from Employee where emp_id = " + intEmpID.ToString()
¡¡¡¡4.ɾ³ý±í¸ñ¼Ç¼¾¯¸æ
private void DataGrid_ItemCreated(Object sender,DataGridItemEventArgs e)
{
¡¡switch(e.Item.ItemType)
¡¡{
¡¡¡¡case ListItemType.Item :
¡¡¡¡case ListItemType.AlternatingItem :
¡¡¡¡case ListItemType.EditItem:
¡¡¡¡¡¡TableCell myTableCell;
¡¡¡¡¡¡myTableCell = e.Item.Cells[14];
¡¡¡¡¡¡LinkButton myDeleteButton ;
¡¡¡¡¡¡myDelete ......
1. ´ò¿ªÐµĴ°¿Ú²¢´«ËͲÎÊý£º
¡¡¡¡´«ËͲÎÊý£º
response.write("£¼script£¾window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)£¼/script£¾")
¡¡¡¡½ÓÊÕ²ÎÊý£º
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
¡¡¡¡2.Ϊ°´Å¥Ìí¼Ó¶Ô»°¿ò
Button1.Attributes.Add("onclick","return confirm(’È·ÈÏ?’)");
button.attributes.add("onclick","if(confirm(’are you sure...?’)){return true;}else{return false;}")
¡¡¡¡3.ɾ³ý±í¸ñÑ¡¶¨¼Ç¼
int intEmpID = (int)MyDataGrid.DataKeys[e.Item.ItemIndex];
string deleteCmd = "DELETE from Employee where emp_id = " + intEmpID.ToString()
¡¡¡¡4.ɾ³ý±í¸ñ¼Ç¼¾¯¸æ
private void DataGrid_ItemCreated(Object sender,DataGridItemEventArgs e)
{
¡¡switch(e.Item.ItemType)
¡¡{
¡¡¡¡case ListItemType.Item :
¡¡¡¡case ListItemType.AlternatingItem :
¡¡¡¡case ListItemType.EditItem:
¡¡¡¡¡¡TableCell myTableCell;
¡¡¡¡¡¡myTableCell = e.Item.Cells[14];
¡¡¡¡¡¡LinkButton myDeleteButton ;
¡¡¡¡¡¡myDelete ......
ASP.NETÊý¾Ý°ó¶¨¿Ø¼þ(GridView¡¢DataList¡¢DetailsView¡¢FormViewµÈ£©ÀïµÄ×Ö¶ÎÉ趨¸ñʽºó£¬È´²»Æð×÷Óã¬ÏÔʾ»¹ÊÇÔÀ´µÄ¸ñʽ£¬Ã»Óа´É趨ÏÔʾ³öÀ´¡£
ÕâÀïÊÇÒªÉèÖÃ×ֶεÄÒ»¸öÊôÐÔ²ÅÄÜÒªÈÃ×ֶθñʽÆð×÷Ó㬠±ØÐëÈÃÊý¾Ý×ֶεÄHtmlEncodeÊôÐÔΪFalse£¬·ñÔò×Ö¶ÎÊý¾Ý²»»á°´¸ñʽÏÔʾ¡£ ......
ÒªÏë×Ô¶¯ÏÔʾ³¬Á´½ÓµÄ¹Ø¼üÔÚÓÚÈçºÎÄÜÕýȷʶ±ð³¬Á´½Ó£¬ºÁÎÞÒÉÎʵģ¬×îÓÐЧµÄ·½·¨ÊÇÓÃÕýÔò±í´ïʽ¡£ÕýÔò±í´ïʽÊÇÓÉÆÕͨ×Ö·û£¨ÀýÈç×Ö·û a µ½ z£©ÒÔ¼°ÌØÊâ×Ö·û£¨³ÆΪԪ×Ö·û£©×é³ÉµÄÎÄ×Öģʽ£¬ÃèÊöÁËÒ»ÖÖ×Ö·û´®Æ¥ÅäµÄģʽ£¬¿ÉÒÔÓÃÀ´¼ì²éÒ»¸ö´®ÊÇ·ñº¬ÓÐijÖÖ×Ó´®¡¢½«Æ¥ÅäµÄ×Ó´®×öÌæ»»»òÕß´Óij¸ö´®ÖÐÈ¡³ö·ûºÏij¸öÌõ¼þµÄ×Ó´®µÈ¡£.net»ù´¡Àà¿âÖаüº¬ÓÐÒ»¸öÃû×Ö¿Õ¼äºÍһϵÁпÉÒÔ³ä·Ö·¢»Ó¹æÔò±í´ïʽÍþÁ¦µÄÀ࣬ÓÃËü¾Í¿ÉÒÔ×Ô¶¯Ì½²â³öÎÄ×ÖÖеÄurlÁ´½Ó»òemailµØÖ·¡£ÏÂÃæÎÒ¾ßÌå½²½²ÈçºÎÓÃasp.net(c#)Ò»²½²½ÊµÏÖÎÒÃǵÄÄ¿µÄ£º
Ê×ÏÈ£¬ÒªÏëÔÚasp.net(c#)ÖÐʹÓÃÕýÔò±í´ïʽ¾Í±ØÐë°Ñ system.text.regularexpressions Õâ¸öÃüÃû¿Õ¼ä°üº¬½øÀ´£º
using system.text.regularexpressions;
µÚ¶þ²½ÊÇÓÃÕýÔò±í´ïʽʶ±ðurl³¬Á´½Ó£º
regex urlregex = new regex(@"(http:\/\/([\w.]+\/@)\s*)",
regexoptions.ignorecase|regexoptions.compiled);
ÕâÀïµÄ´úÂëÊÇÓÃÕýÔò±í´ïʽʶ±ðemailµØÖ·£º
regex emailregex = new regex(@"([a-za-z_0-9.-]+\@[a-za-z_0-9.-]+\.\w+)",
regexoptions.ignorecase|regexoptions.compiled);
µÚÈý²½£¬µ±³ÌÐòÒѾʶ±ð³öurl³¬Á´½Ó»òemailµØÖ·ºó£¬ ......
1.ʲôÊÇcookie?
cookie ÊÇһС¶ÎÎı¾ÐÅÏ¢£¬°éËæÓû§ÇëÇó£¬ÔÚweb·þÎñÆ÷ºÍä¯ÀÀÆ÷Ö®¼ä´«µÝ¡£Óû§Ã¿´Î·ÃÎÊÕ¾µãµÄʱºò£¬
webÓ¦ÓóÌÐò¶¼¿ÉÒÔ¶ÁÈ¡cookie°üº¬µÄÐÅÏ¢¡£
¼ÙÉèÔÚÓû§ÇëÇóÄúµÄÍøÕ¾µÄij¸öÒ³Ãæʱ£¬ÄúµÄÓ¦ÓóÌÐò²»½öÊÇ·µ»ØÇëÇóµÄÒ³Ã档ͬʱҲ·µ»ØÒ»¸ö°üº¬ÈÕÆÚ
ºÍʱ¼äµÄcookie¡£Óû§µÄä¯ÀÀÆ÷ÔÚ»ñµÃÒ³ÃæµÄͬʱҲ»ñµÃÁËcookie.²¢ÇÒcookie±£´æÔÚ¿Í»§¶ËµÄcookieÎÄ
¼þ¼ÐÖС£
2.cookie µÄÏÞÖÆ
´ó¶àÊýä¯ÀÀÆ÷Ö§³Ö×î¶à¿É´ï4096×Ö½Ú£¨´óÔ¼4KB£©cookie.ä¯ÀÀÆ÷»¹ÏÞÖÆÁË£¬Ò»¸öÕ¾µã¿ÉÒÔÔÚ¿Í»§¶Ë±£´æ
cookieÊý¡£´ó¶àÊýä¯ÀÀÆ÷ÔÊÐíÿ¸öÕ¾µã×î¶à·Å20¸öcookie.Èç¹ûÊÔͼ±£´æ¸ü¶àµÄcookie,ÄÇôÏÈÇ°µÄcookie
½«±»É¾³ý¡£»¹ÓÐЩä¯ÀÀÆ÷»á¶ÔÀ´×ÔËùÓÐÕ¾µãcookie×ÜÊýÏÞÖÆ£¬Õâ¸öÏÞÖÆͨ³£Îª300¸ö¡£
3.cookie ÈçºÎ´´½¨
ÔÚ´´½¨cookieµÄʱºòÒªÖ¸¶¨¼¸¸öÖµ¡£×î³õ£¬ÄúÒªÖ¸¶¨cookieµÄÃû×ÖºÍÒª±£´æµÄÖµ¡£ÄúÒ²¿ÉÒÔ´´½¨¶à¸ö
cookie¡£µ«Ã¿¸öcookieµÄÃû×Ö±ØÐëΨһ£¬ÒÔ±ãÈÕºóȡֵʱʶ±ð¡££¨cookieÊÇ°´Ãû×Ö´¢´æµÄ£¬ËùÒÔÄúÒª´´½¨
Á½¸öÃû³ÆÏàͬµÄcookie£¬ÄÇô×îºóÄǸöcookie½«¸²¸ÇÇ°Ò»¸ö¡££©
ÄúÒ²¿ÉÒÔ¸øcookieÖ¸¶¨¹ýÆÚÈÕÆÚºÍʱ¼ä.cookieÊÇдÈëµ½Óû§Ó²ÅÌÉϵģ¬È»ºó¿ÉÄÜÒ»Ö±¶¼ÁôÔÚ´ÅÅÌÉÏ¡£Òò
´Ë£¬Äú¿ÉÒÔ ......
ʹÓÃASP.Net FormsģʽʵÏÖWebServiceÉí·ÝÑéÖ¤
ÔÚ°²È«ÐÔÒªÇó²»ÊǺܸߵÄASP.Net³ÌÐòÖУ¬»ùÓÚFormsµÄÉí·ÝÑéÖ¤ÊǾ³£Ê¹ÓõÄÒ»ÖÖ·½Ê½£¬¶øÈç¹ûÐèÒª¶ÔWebService½øÐÐÉí·ÝÑéÖ¤£¬×î³£ÓõĿÉÄÜÊÇ»ùÓÚSoap ±êÍ·µÄ×Ô¶¨ÒåÉí·ÝÑéÖ¤·½Ê½¡£Èç¹û¶ÔÁ½Õß×öһϱȽϵĻ°£¬ÏÔÈ»£¬»ùÓÚFormsµÄÑéÖ¤·½Ê½¸ü¼Ó·½±ãÒ×Óã¬ÄÜ·ñ½«FormsÑéÖ¤·½Ê½Ó¦Óõ½WebServiceÖÐÈ¥ÄØ£¿
´ÓÀíÂÛÉϽ²£¬Ê¹ÓûùÓÚFormsµÄ·½Ê½¶ÔWebService½øÐÐÉí·ÝÑéÖ¤ÊÇ¿ÉÐеģ¬µ«ÊÇʹÓùý³ÌÖлá´æÔÚÒÔÏÂÁ½¸öÎÊÌ⣺
1.»ùÓÚFormsµÄÑéÖ¤·½Ê½Í¬Ê±Ò²ÊÇ»ùÓÚCookieµÄÑéÖ¤·½Ê½£¬ÔÚʹÓÃä¯ÀÀÆ÷ʱ£¬Õâ¸öÎÊÌâÊDz»ÐèÒªÎÒÃÇ¿¼Âǵġ£µ«¶ÔÓÚʹÓÃWebServiceµÄÓ¦ÓóÌÐòÀ´Ëµ£¬Ä¬ÈÏÊDz»Äܱ£´æCookieµÄ£¬ÐèÒªÎÒÃÇ×Ô¼ºÈ¥×öÕâ¸ö¹¤×÷¡£
2.WebService¼ÈÈ»ÊÇÒ»¸öA2A(Application To Application)Ó¦ÓóÌÐò£¬Ê¹ÓÃWeb±íµ¥½øÐÐÉí·ÝÑéÖ¤ÏÔÈ»²»Ì«ºÏÊÊ£¬¶øÇÒ£¬Õ⽫²»¿É±ÜÃâµÄÔì³ÉÈË»ú½»»¥£¬Ê¹WebServiceµÄÓ¦Óôó´òÕÛ¿Û¡£
½ÓÏÂÀ´£¬ÎÒÃǾͷֲ½½â¾öÕâÁ½¸öÎÊÌ⣺
1.CookieµÄ±£´æÎÊÌâ
WebServiceµÄ¿Í»§¶Ë´úÀíÀàÓÐÒ»¸öÊôÐÔCookieContainer¿ÉÓÃÓÚÉèÖûò»ñÈ¡Cookie¼¯ºÏ£¬±£´æCookieµÄÈÎÎñ¾Í½»¸øËûÁ ......
×ܼǼÊý:2672; ×ÜÒ³Êý:446; ÿҳ6 Ìõ;
Ê×Ò³ ÉÏÒ»Ò³ [1] [2] [3] [4] 5
[6] [7] [8] [9] [10] ÏÂÒ»Ò³ βҳ