¡¾×ª¡¿asp.net ¿Í»§¶Ë»Øµ÷֪ͨ
ÔÚ ASP.NET ÍøÒ³µÄĬÈÏÄ£ÐÍÖУ¬Óû§»áÓëÒ³½»»¥£¬µ¥»÷°´Å¥»òÖ´Ðе¼Ö»ط¢µÄһЩÆäËû²Ù×÷¡£´Ëʱ½«ÖØд´½¨Ò³¼°Æä¿Ø¼þ£¬²¢ÔÚ·þÎñÆ÷ÉÏÔËÐÐÒ³´úÂ룬ÇÒа汾µÄÒ³±»³ÊÏÖµ½ä¯ÀÀÆ÷¡£µ«ÊÇ£¬ÔÚÓÐЩÇé¿öÏ£¬ÐèÒª´Ó¿Í»§¶ËÔËÐзþÎñÆ÷´úÂ룬¶ø²»Ö´Ðлط¢¡£Èç¹ûÒ³ÖеĿͻ§¶Ë½Å±¾Î¬»¤Ò»Ð©×´Ì¬ÐÅÏ¢£¨ÀýÈ磬¾Ö²¿±äÁ¿Öµ£©£¬ÄÇô·¢ËÍÒ³ºÍ»ñÈ¡Ò³µÄи±±¾¾Í»áË𻵸Ã״̬¡£´ËÍ⣬ҳ»Ø·¢»áµ¼Ö´¦Àí¿ªÏú£¬Õâ»á½µµÍÐÔÄÜ£¬ÇÒ»áÈÃÓû§²»µÃ²»µÈ´ý´¦Àí²¢ÖØд´½¨Ò³¡£
ÈôÒª±ÜÃⶪʧ¿Í»§¶Ë״̬²¢ÇÒ²»µ¼Ö·þÎñÆ÷Íù·µµÄ´¦Àí¿ªÏú£¬¿ÉÒÔ¶Ô ASP.NET ÍøÒ³±àÂ룬ʹÆäÄÜÖ´Ðпͻ§¶Ë»Øµ÷¡£ÔÚ¿Í»§¶Ë»Øµ÷ÖУ¬¿Í»§¶Ë½Å±¾º¯Êý»áÏò ASP.NET ÍøÒ³·¢ËÍÒ»¸öÇëÇ󡣸ÃÍøÒ³ÔËÐÐÆäÕý³£ÉúÃüÖÜÆÚµÄÐ޸İ汾 — ³õʼ»¯Ò³²¢´´½¨Æä¿Ø¼þºÍÆäËû³ÉÔ±£¬È»ºóµ÷ÓÃÌرð±ê¼ÇµÄ·½·¨¡£¸Ã·½·¨Ö´ÐдúÂëÖбàдµÄ´¦Àí¹ý³Ì£¬È»ºóÏòä¯ÀÀÆ÷·µ»Ø¿ÉÓÉÁíÒ»¿Í»§¶Ë½Å±¾º¯Êý¶ÁÈ¡µÄÖµ¡£Ôڴ˹ý³ÌÖУ¬¸ÃҳһֱפÁôÔÚä¯ÀÀÆ÷ÖС£
Óм¸¸ö Web ·þÎñÆ÷¿Ø¼þʹÓÿͻ§¶Ë»Øµ÷¡£ÀýÈ磬TreeView ¿Ø¼þʹÓÿͻ§¶Ë»Øµ÷ʵÏÖÆä¼´ÐèÌî³ä¹¦ÄÜ¡£Óйظü¶àÐÅÏ¢£¬Çë²Î¼û TreeView Web ·þÎñÆ÷¿Ø¼þ¸ÅÊö¡£
¿Í»§¶Ë»Øµ÷×é¼þ
´´½¨ÊµÏÖ¿Í»§¶Ë»Øµ÷µÄ ASP.NET Ò³Óë´´½¨ÈκΠASP.NET Ò³ÀàËÆ£¬µ«Ò²ÓÐÈçÏÂÕâЩÇø±ð¡£Ò³µÄ·þÎñÆ÷´úÂë±ØÐ룺
ʵÏÖ ICallbackEventHandler ½Ó¿Ú¡£¿ÉÒÔÏòÈκΠASP.NET ÍøÒ³Ìí¼Ó´Ë½Ó¿ÚÉùÃ÷¡£
Ìṩ RaiseCallbackEvent ·½·¨µÄʵÏÖ¡£´Ë·½·¨½«±»µ÷ÓÃÒÔ¶Ô·þÎñÆ÷Ö´Ðлص÷¡£
Ìṩ GetCallbackResult ·½·¨µÄʵÏÖ¡£´Ë·½·¨»á½«»Øµ÷½á¹û·µ»Ø¸ø¿Í»§¶Ë¡£
´ËÍ⣬¸ÃÒ³»¹±ØÐë°üº¬Ö´ÐÐÒÔϲÙ×÷µÄÈý¸ö¿Í»§¶Ë½Å±¾º¯Êý£º
Ò»¸öº¯Êýµ÷ÓðïÖúÆ÷·½·¨£¬¸Ã·½·¨Ö´ÐжԷþÎñÆ÷µÄʵ¼ÊÇëÇó¡£Ôڴ˺¯ÊýÖУ¬¿ÉÒÔÊ×ÏÈÖ´ÐÐ×Ô¶¨ÒåÂß¼ÒÔ×¼±¸Ê¼þ²ÎÊý£¬È»ºó¿ÉÒÔ½«Ò»¸ö×Ö·û´®×÷Ϊ²ÎÊý·¢Ë͵½·þÎñÆ÷¶Ë»Øµ÷ʼþ´¦Àí³ÌÐò¡£
ÁíÒ»¸öº¯ÊýÓÉ´¦Àí»Øµ÷ʼþµÄ·þÎñÆ÷´úÂëµÄ½á¹ûµ÷Óò¢½ÓÊոýá¹û£¬Í¬Ê±½ÓÊܱíʾ¸Ã½á¹ûµÄ×Ö·û´®¡£¸Ãº¯Êý³ÆΪ¿Í»§¶Ë»Øµ÷º¯Êý¡£
µÚÈý¸öº¯ÊýÊÇÖ´ÐжԷþÎñÆ÷µÄʵ¼ÊÇëÇóµÄ Helper º¯Êý£¬µ±ÔÚ·þÎñÆ÷´úÂëÖÐʹÓà GetCallbackEventReference ·½·¨Éú³É¶Ô´Ëº¯ÊýµÄÒýÓÃʱ£¬ÓÉ ASP.NET ×Ô¶¯Éú³É¸Ãº¯Êý¡£
¿Í»§¶Ë»Øµ÷¼°»Ø·¢¶¼ÊǶÔÆðʼҳµÄÇëÇó£¬Òò´ËÔÚ Web ·þÎñÆ÷ÈÕÖ¾Öн«¿Í»§¶Ë»Øµ÷¼°»Ø·¢¼Ç¼ΪҳÇëÇó¡£
ÔÚ·þÎñÆ÷´úÂëÖÐʵÏÖºÏÊʵĽӿÚ
ÈôÒª´Ó¿Í»§¶Ë³É¹¦ÔËÐзþÎñÆ÷´úÂë¶ø²»Ö´Ðлط¢£¬Ôò±ØÐëÔÚ·þÎñÆ÷´úÂëÖÐʵÏÖºÏÊʵĽӿÚ
Ïà¹ØÎĵµ£º
ASP.NET 4µÄWeb Formsµ±ÖУ¬×îÁîÈ˼¤É͵ģ¬ÔòĪ¹ýÓÚÊÇURL Routing»úÖƵÄÈ«ÃæÖ§³Ö¡£¹ýÈ¥ÔÚASP.NET 3.5 SP1µ±ÖУ¬Web Forms»ò¶à»òÉپͿªÊ¼Ö§³ÖURL Routing»úÖÆ£¬ËüÈÃÎÒÃÇÔÚÍøÖ·µÄ³ÊÏÖÒÔ¼°Ê¹ÓÃÉϸü¼ÓµÄÓе¯ÐÔ¡£
¹ýÈ¥ÎÒÃÇÔÚASP.NETµ±ÖУ¬Ï°¹ßÓÚµ×ÏÂÕâÑùµÄÍøÖ·³ÊÏÖ·½Ê½£º
http://myWebSite/EditProduct.aspx?Id=1
µ«×î½ü¼¸ÄêR ......
ÔÚÒ»¸öÏîÄ¿¿ª·¢ÖУ¬showdialogµ¯³ö¶Ô»°¿òʱ£¬ÎÒ֮ǰÐ޸ĹýµÄÊý¾Ý²»»á¼°Ê±¸üУ¡
ʹÓýûÓÃURL»º´æµÄ·½·¨,½â¾öÕâ¸öÎÊÌâ
ÔÚasp.netÒ³ÃæµÄºǫ́
if (!IsPostBack)
{
Response.Buffer = true;
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
/// <summary>
/// ÉùÃ÷ίÍÐ
/// </summary>
/// <param name="name"></param>
public delegate void GreetPeopleDelegate(st ......
1¡¢IsStartupScriptRegistered£º¶ÔÏóÊÇ·ñ×¢²áÁËÆôÓýű¾¡£
2¡¢IsClientScriptBlockRegistered£º¶ÔÏóÊÇ·ñ×¢²áÁË¿Í»§¶Ë½Å±¾¿é¡£
3¡¢IsClientScriptIncludeRegistered£º¶ÔÏóÊÇ·ñ×¢²áÁË¿Í»§¶Ë½Å±¾°üº¬¡£
µÚÒ»¸öÀý×Ó£º
string info = "<script>alert('ÄãºÃÂð£¿');</script>";
//ÅжÏʼþÊÇ·ñ±»×¢²á£¬Ð´ÈëÇ ......