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

asp.net mvc¿ò¼ÜÖÐjsonÐòÁл¯µÄ¿ØÖÆ

ÏÈ¿´ÏÂÃæµÄÒ»¶Î´úÂ룺
 public class UserTest
        {
           public int age { set; get;
}          
¡¡¡¡¡¡¡¡ public string name { set; get; }         }
ÕâÊÇ×¼±¸ jsonÐòÁл¯µÄÀ࣬ÓÃmvc¿ò¼ÜÌṩµÄjson·½·¨£¬ºÜ¿ì¾Í¿ÉÒÔÍê³É£¬´úÂëÈçÏ£º
  public ActionResult TestAjax(int? page)
        {
           
UserTest test = new UserTest() { age = 20, name = "aa" };
            return
Json(test)
        }
ÏÖÔÚÎÊÌâÊÇÒª¿ØÖÆÐòÁл¯µÄÊôÐÔ£¬±ÈÈç˵ÏëÈÃnameÐòÁл¯£¬age²»ÐòÁл¯£¬ÈçºÎ×öµ½¡£
NonSerializedºÍXmlIgnore¶¼²»¿ÉÒÔ¡£ÓÖÊÔÁËÏÂÓÃ[DataContract]Ò²²»¿ÉÒÔ£¬Í»È»Ï뵽Ϊʲô²»¿´¿´jsonʵÏÖµÄÔ´ÂëÁË£¬´ò¿ªmvc¿ò¼ÜÔ´Â룬ÕÒµ½json·½·¨µÄÔ´ÂëÈçÏ£º
 public override void ExecuteResult(ControllerContext context)
{
            if (context == null) {
                throw new
ArgumentNullException("context");
            }
           
HttpResponseBase response = context.HttpContext.Response;
            if
(!String.IsNullOrEmpty(ContentType)) {
                response.ContentType =
ContentType;
            }
            else {
               
r


Ïà¹ØÎĵµ£º

asp.netÒ³ÃæתÏò

1.<a href=”test.aspx”></a>
2.ÕâÊÇ×î³£¼ûµÄÒ»ÖÖתÏò·½·¨;
HyperLink¿Ø¼þ
1.Asp.net ·þÎñÆ÷¶Ë¿Ø¼þ ÊôÐÔNavigateUrlÖ¸¶¨ÒªÌøתµ½µÄUrlµØÖ·
2.NavigateUrlÊÇ¿ÉÒÔÔÚ·þÎñÆ÷¶ËʹÓôúÂëÐ޸ģ¬Õâ¸öÇø±ðÓÚ<a>
3.ÓÉÓÚHyperLink±¾ÉíûÓÐʼþËùÒÔÒªÔÚ·þÎñÆ÷¶ËÆäËüʼþÖÐÉèÖÃNavigateUrl
4.´ ......

Asp.Net onclientclick

ÔÚAsp.Net2.0ÖУ¬button¿Ø¼þÌí¼ÓÁËonclientclickÊôÐÔ£¬Í¨¹ýÕâ¸öÊôÐÔ¿ÉÒÔÏÈÖ´Ðпͻ§¶Ë½Å±¾£¬È»ºó¸ù¾Ý·µ»ØÖµÔÙÖ´ÐзþÎñÆ÷¶Ë½Å±¾¡£
ÔÚ¹¤×÷ÖÐÓöµ½ÕâÑùÒ»ÖÖ³¡¾°£ºµã»÷Ò»¸öbuttonºó£¬ÏÔʾһ¸ögif¶¯»­Í¼Æ¬£¬È»ºóÔÙÖ´ÐзþÎñÆ÷¶ËµÄ½Å±¾¡£gif¶¯»­Í¼Æ¬·Åµ½Ò»¸öÒþ²ØµÄdivÖУ¬µã»÷buttonÒÔºó£¬div»áÏÖÉí£¬ÏÔʾgifͼƬ¡£
ÎÊÌâÊÇ£ºÔÚfire ......

ASP.NET¿çÒ³Ãæ´«Öµ¼¼ÇÉ×ܽá

¹ØÓÚÒ³Ãæ´«ÖµµÄ·½·¨£¬Òý·¢Á˺ܶàÌÖÂÛ¡£¿´À´ÓкܶàÈ˹Ø×¢Õâ¸ö£¬ÎÒ¾ÍÎÒ¸öÈ˹۵ã×öÁËЩ×ܽᣬϣÍû¶Ô´ó¼ÒÓÐËù°ïÖú¡£
1.  ʹÓÃQueryString±äÁ¿
QueryStringÊÇÒ»Öַdz£¼òµ¥µÄ´«Öµ·½Ê½£¬Ëû¿ÉÒÔ½«´«Ë͵ÄÖµÏÔʾÔÚä¯ÀÀÆ÷µÄµØÖ·À¸ÖС£Èç¹ûÊÇ´«µÝÒ»¸ö»ò¶à¸ö°²È«ÐÔÒªÇ󲻸߻òÊǽṹ¼òµ¥µÄÊýֵʱ£¬¿ÉÒÔʹÓÃÕâ¸ö·½·¨¡£µ«ÊǶÔÓÚ´«µ ......

ASP.NET±à³ÌÄ£ÐÍÖ®ASP.NETÒ³ÃæÉúÃüÖÜÆÚͼ½â

ASP.NET±à³ÌÄ£ÐÍÖÐASP.NETÒ³ÃæÉúÃüÖÜÆÚÊÇָʲôÄØ£¿Ëü°üÀ¨Ê²Ã´ÄØ£¿ASP.NET±à³ÌÄ£ÐÍÖ®ASP.NETÒ³ÃæÉúÃüÖÜÆÚ¾ßÌåµÄ¹ý³ÌÓÐÄÄЩÄØ£¿ÏÂÃæ¾Í¿ªÊ¼ÎÒÃǵĽ²½â°É£º
ASP.NET Ò³ÔËÐÐʱ£¬´ËÒ³½«¾­ÀúÒ»¸öÉúÃüÖÜÆÚ£¬ÔÚÉúÃüÖÜÆÚÖн«Ö´ÐÐһϵÁд¦Àí²½Öè¡£ÕâЩ²½Öè°üÀ¨³õʼ»¯¡¢ÊµÀý»¯¿Ø¼þ¡¢»¹Ô­ºÍά»¤×´Ì¬¡¢ÔËÐÐʼþ´¦Àí³ÌÐò´úÂëÒÔ¼°½øÐгÊÏÖ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ