Jquery与.net MVC结合,通过Ajax

在工作中做了这么一个东西。

Html端:

Html代码  收藏代码
  1. @using Test.fh.Project.Storefront.ViewModels  
  2. @using Test.fh.Project.Storefront.Services  
  3. @model ProductViewModel  
  4. <div id="column-left">  
  5.     <div class="box">  
  6.         <div class="box-heading">  
  7.             Categories</div>  
  8.         <div class="box-content">  
  9.             <div class="box-category">  
  10.                   
  11.             </div>  
  12.         </div>  
  13.     </div>  
  14. </div>  
  15. <div id="content">  
  16.     <div class="breadcrumb">  
  17.         @Html.Partial("_Breadcrumbs")  
  18.     </div>  
  19.     <h1>  
  20.         @MvcHtmlString.Create(@Model.product_name)  
  21.     </h1>  
  22.     @using (Html.BeginForm("index", "Product"))  
  23.     {  
  24.         @Html.ValidationSummary(excludePropertyErrors: true)  
  25.         <div class="product-info">  
  26.             <div class="left">  
  27.                 <div class="image">  
  28.                     <href="@Url.Content("~/Content/images/" + @Model.thumbImagePopPath)" title="@Model.product_name"  
  29.     class="fancybox" rel="fancybox">  
  30.                         <img src="@Url.Content("~/Content/images/" + @Model.thumbImagePath)"  title="@Model.product_name"  
  31.     alt="@Model.product_name" id="image" />  
  32.                     </a>  
  33.                 </div>  
  34.                 @if (Model.imagePaths.Count() > 0)  
  35.                 {  
  36.                     <div class="image-additional">  
  37.                         @foreach (var item in Model.imagePaths)  
  38.                         {  
  39.                             <href="@Url.Content("~/Content/images/" + @item.imagePopPath)" title="@Model.product_name" class="fancybox" rel="fancybox">  
  40.                                 <img src="@Url.Content("~/Content/images/" + @item.imagePath)" title="@Model.product_name" alt="@Model.product_name"/>  
  41.                             </a>  
  42.                         }  
  43.                     </div>  
  44.                 }  
  45.             </div>  
  46.             <div class="right">  
  47.                 <div class="description">  
  48.                     @if (Model.manufacturer != null || Model.manufacturer != "")  
  49.                     {  
  50.                         <span>Brand: </span<href="@Model.manufacturer_id">@Model.manufacturer</a><br />  
  51.                     }  
  52.                     <span>Product Code: </span>@Model.model<br />  
  53.                     <span>Reward Points:</span> @Model.reward<br />  
  54.                     <span>Availability: </span>@Model.stock_status  
  55.                 </div>  
  56.                 <div class="price">  
  57.                     Price:  
  58.                     @if (Model.special == null || Model.special == "")  
  59.                     {  
  60.                         @Currency.format(Model.price, null, null, true)  
  61.                     }  
  62.                     else  
  63.                     {  
  64.                         <span class="price-old">@Currency.format(Model.price, null, null, true)</span>  
  65.                         <span class="price-new">@Currency.format(Model.special, null, null, true)</span>  
  66.                     }  
  67.                     <br />  
  68.                     <span class="price-tax">Ex Tax:  
  69.                         @if (Model.special != null && Model.special != "")  
  70.                         {  
  71.                             @Currency.format(Model.special, null, null, true)  
  72.                         }  
  73.                         else  
  74.                         {  
  75.                             @Currency.format(Model.price, null, null, true)  
  76.                         }  
  77.                     </span>  
  78.                     <br />  
  79.                     <span class="reward"><small>Price in reward points: @Model.points</small></span>  
  80.                     <br />  
  81.                     <br />  
  82.                     <div class="discount">  
  83.                         @foreach (var item in ViewBag.Discounts)  
  84.                         {  
  85.                             @string.Format("({0} or more {1})", @item["quantity"], @Currency.format(item["price"].ToString(), null, null, true));  
  86.                             <br />  
  87.                         }  
  88.                     </div>  
  89.                 </div>  
  90.                 @if (ViewBag.Options != null)  
  91.                 {  
  92.                     <div class="options">  
  93.                         <h2>  
  94.                             Available Options</h2>  
  95.                         <br />  
  96.                         @foreach (var item in ViewBag.Options)  
  97.                         {  
  98.                             if (item.Key["type"] == "select")  
  99.                             {  
  100.                             <div id="option-@item.Key["product_option_id"]" class="option">  
  101.                                 @if (item.Key["required"] != null && item.Key["required"] == 1)  
  102.                                 {  
  103.                                     <span class="required">*</span>  
  104.                                 }  
  105.                                 <b>@item.Key["name"]:</b><br />  
  106.                                 <select name="option[@item.Key["product_option_id"]]">  
  107.                                     <option value="">--- Please Select ---</option>  
  108.                                     @foreach (var option_value in item.Value)  
  109.                                     {  
  110.                                         <option value="@option_value["product_option_value_id"]">@option_value["name"]  
  111.                                             @if (@option_value["price"] != null)  
  112.                                             {  
  113.                                                 @string.Format("({0}{1})", @option_value["price_prefix"], @Currency.format(option_value["price"].ToString(), null, null, true));  
  114.                                             }  
  115.                                         </option>  
  116.                                     }  
  117.                                 </select>  
  118.                             </div>  
  119.                             <br />  
  120.                             }  
  121.                             if (item.Key["type"] == "radio")  
  122.                             {  
  123.                             <div id="option-@item.Key["product_option_id"]" class="option">  
  124.                                 @if (item.Key["required"] != null && item.Key["required"] == 1)  
  125.                                 {  
  126.                                     <span class="required">*</span>  
  127.                                 }  
  128.                                 <b>@item.Key["name"]:</b><br />  
  129.                                 @foreach (var option_value in item.Value)  
  130.                                 {  
  131.                                     <input type="radio" name="option[@option_value["product_option_id"]]" value="@option_value["product_option_value_id"]"  
  132.                 id="option-value-@option_value["product_option_value_id"]" />  
  133.                                     <label for="option-value-@option_value["product_option_value_id"]">@option_value["name"]  
  134.                                         @if (@option_value["price"] != null)  
  135.                                         {  
  136.                                             @string.Format("({0}{1})", @option_value["price_prefix"], @Currency.format(option_value["price"].ToString(), null, null, true));  
  137.                                         }  
  138.                                     </label>  
  139.                                     <br />  
  140.                                 }  
  141.                             </div>  
  142.                             <br />  
  143.                             }  
  144.   
  145.                             if (item.Key["type"] == "checkbox")  
  146.                             {  
  147.                             <div id="option-@item.Key["product_option_id"]" class="option">  
  148.                                 @if (item.Key["required"] != null && item.Key["required"] == 1)  
  149.                                 {  
  150.                                     <span class="required">*</span>  
  151.                                 }  
  152.                                 <b>@item.Key["name"]:</b><br />  
  153.                                 @foreach (var option_value in item.Value)  
  154.                                 {  
  155.                                     <input type="checkbox" name="option[@option_value["product_option_id"]]" value="@option_value["product_option_value_id"]"  
  156.                 id="option-value-@option_value["product_option_value_id"]" />  
  157.                                     <label for="option-value-@option_value["product_option_value_id"]">@option_value["name"]  
  158.                                         @if (@option_value["price"] != null)  
  159.                                         {  
  160.                                             @string.Format("({0}{1})", @option_value["price_prefix"], @Currency.format(option_value["price"].ToString(), null, null, true));  
  161.                                         }  
  162.                                     </label>  
  163.                                     <br />  
  164.                                 }  
  165.                             </div>  
  166.                             <br />  
  167.                             }  
  168.   
  169.                             if (item.Key["type"] == "text")  
  170.                             {  
  171.                             <div id="option-@item.Key["product_option_id"]" class="option">  
  172.                                 @if (item.Key["required"] != null && item.Key["required"] == 1)  
  173.                                 {  
  174.                                     <span class="required">*</span>  
  175.                                 }  
  176.                                 <b>@item.Key["name"]:</b><br />  
  177.                                 <input type="text" name="option[@item.Key["product_option_id"]]"  
  178.             value="@item.Key["option_value"]" />  
  179.                             </div>  
  180.                             <br />  
  181.                             }  
  182.   
  183.                             if (item.Key["type"] == "textarea")  
  184.                             {  
  185.                             <div id="option-@item.Key["product_option_id"]" class="option">  
  186.                                 @if (item.Key["required"] != null && item.Key["required"] == 1)  
  187.                                 {  
  188.                                     <span class="required">*</span>  
  189.                                 }  
  190.                                 <b>@item.Key["name"]:</b><br />  
  191.                                 <textarea name="option[@item.Key["product_option_id"]]"  
  192.             cols="40" rows="5">@item.Key["option_value"]</textarea>  
  193.                             </div>  
  194.                             <br />  
  195.                             }  
  196.   
  197.                             if (item.Key["type"] == "file")  
  198.                             {  
  199.                             <div id="option-@item.Key["product_option_id"]" class="option">  
  200.                                 @if (item.Key["required"] != null && item.Key["required"] == 1)  
  201.                                 {  
  202.                                     <span class="required">*</span>  
  203.                                 }  
  204.                                 <b>@item.Key["name"]:</b><br />  
  205.                                 <id="button-option-option[@item.Key["product_option_id"]]"  
  206.             class="button"><span>Upload File</span></a>  
  207.                                 <input type="hidden" name="option[@item.Key["product_option_id"]]"  
  208.             value="" />  
  209.                             </div>  
  210.                             <br />  
  211.                             }  
  212.   
  213.                             if (item.Key["type"] == "date")  
  214.                             {  
  215.                             <div id="option-@item.Key["product_option_id"]" class="option">  
  216.                                 @if (item.Key["required"] != null && item.Key["required"] == 1)  
  217.                                 {  
  218.                                     <span class="required">*</span>  
  219.                                 }  
  220.                                 <b>@item.Key["name"]:</b><br />  
  221.                                 <input type="text" name="option[@item.Key["product_option_id"]]"  
  222.             value="@item.Key["option_value"]" class="date" />  
  223.                             </div>  
  224.                             <br />  
  225.                             }  
  226.   
  227.                             if (item.Key["type"] == "datetime")  
  228.                             {  
  229.                             <div id="option-@item.Key["product_option_id"]" class="option">  
  230.                                 @if (item.Key["required"] != null && item.Key["required"] == 1)  
  231.                                 {  
  232.                                     <span class="required">*</span>  
  233.                                 }  
  234.                                 <b>@MvcHtmlString.Create(@item.Key["name"]):</b><br />  
  235.                                 <input type="text" name="option[@item.Key["product_option_id"]]"  
  236.             value="@item.Key["option_value"]" class="datetime" />  
  237.                             </div>  
  238.                             <br />  
  239.                             }  
  240.   
  241.                             if (item.Key["type"] == "time")  
  242.                             {  
  243.                             <div id="option-@item.Key["product_option_id"]" class="option">  
  244.                                 @if (item.Key["required"] != null && item.Key["required"] == 1)  
  245.                                 {  
  246.                                     <span class="required">*</span>  
  247.                                 }  
  248.                                 <b>@MvcHtmlString.Create(@item.Key["name"]):</b><br />  
  249.                                 <input type="text" name="option[@item.Key["product_option_id"]]"  
  250.             value="@item.Key["option_value"]" class="time" />  
  251.                             </div>  
  252.                             <br />  
  253.                             }  
  254.                         }  
  255.                     </div>  
  256.                 }  
  257.                 <div class="cart">  
  258.                     <div>  
  259.                         Qty:  
  260.                         @Html.TextBoxFor(model => model.minimum, new { maxlength = 2, name = "quantity" })  
  261.                         @Html.HiddenFor(model => model.product_id) &nbsp <id="button-cart" class="button">  
  262.                             <span>Add to Cart</span</a>  
  263.                     </div>  
  264.                     <div>  
  265.                         <span>&nbsp;&nbsp;&nbsp;- OR -&nbsp;&nbsp;&nbsp;</span>  
  266.                     </div>  
  267.                     <div>  
  268.                         <onclick="addToWishList('@Model.product_id');">Add to Wish List</a><br />  
  269.                         <onclick="addToCompare('@Model.product_id');">Add to Compare</a>  
  270.                     </div>  
  271.                     @if (int.Parse(Model.minimum) > 1)  
  272.                     {  
  273.                         <div class="minimum">  
  274.                             This product has a minimum quantity of @Model.minimum</div>  
  275.                     }  
  276.                 </div>  
  277.                 <div class="review">  
  278.                     <div>  
  279.                         <img src="@string.Format("/cart/Content/catalog/theme/default/image/stars-{0}.png", Model.rating)" alt="@Model.rating" />&nbsp;&nbsp;  
  280.                         <onclick="$('a[href=\'#tab-review\']').trigger('click');">  
  281.                             @Model.reviews reviews </a>&nbsp;&nbsp;|&nbsp;&nbsp;<onclick="$('a[href=\'#tab-review\']').trigger('click');">Write  
  282.                                 a review</a>  
  283.                     </div>  
  284.                     <div class="share">  
  285.                         <!-- AddThis Button BEGIN -->  
  286.                         <div class="addthis_default_style">  
  287.                             <class="addthis_button_compact">Share</a<class="addthis_button_email"></a>  
  288.                             <class="addthis_button_print"></a><class="addthis_button_facebook"></a><class="addthis_button_twitter">  
  289.                             </a>  
  290.                         </div>  
  291.                         <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js"></script>  
  292.                         <!-- AddThis Button END -->  
  293.                     </div>  
  294.                 </div>  
  295.             </div>  
  296.         </div>  
  297.         <div id="tabs" class="htabs">  
  298.             <href="#tab-description">Description</a>  
  299.             @if (ViewBag.attribute_groups != null)  
  300.             {  
  301.                 <href="#tab-attribute">Specification</a>  
  302.             }  
  303.             <href="#tab-review">Reviews </a>  
  304.             @if (ViewBag.relate_products != null)  
  305.             {  
  306.                 <href="#tab-related">Related Products (@ViewBag.relate_products.Count)</a>  
  307.             }  
  308.         </div>  
  309.         <div id="tab-description" class="tab-content">@Html.Raw(@Model.description)</div>  
  310.                                                  if (ViewBag.attribute_groups != null)  
  311.                                                  {  
  312.         <div id="tab-attribute" class="tab-content">  
  313.             <table class="attribute">  
  314.                 @foreach (var item in ViewBag.attribute_groups)  
  315.                 {  
  316.                     <thead>  
  317.                         <tr>  
  318.                             <td colspan="2">  
  319.                                 @item.Key["name"]  
  320.                             </td>  
  321.                         </tr>  
  322.                     </thead>  
  323.                     <tbody>  
  324.                         @foreach (var item_att in item.Value)  
  325.                         {  
  326.                             <tr>  
  327.                                 <td>@item_att["name"]  
  328.                                 </td>  
  329.                                 <td>@item_att["text"]  
  330.                                 </td>  
  331.                             </tr>  
  332.                         }  
  333.                     </tbody>  
  334.                 }  
  335.             </table>  
  336.         </div>  
  337.                                                  }  
  338.         <div id="tab-review" class="tab-content">  
  339.               
  340.         </div>  
  341.   
  342.                                                  if (ViewBag.relate_products != null)  
  343.                                                  {  
  344.         <div id="tab-related" class="tab-content">  
  345.             <div class="box-product">  
  346.                 @foreach (var item in ViewBag.relate_products)  
  347.                 {  
  348.   
  349.                     <div>  
  350.                         @if (item["image"] != null)  
  351.                         {  
  352.                             <div class="image">  
  353.                                 <href="@item["product_id"]">  
  354.                                     <img src="@Url.Content("~/Content/images/" + @item["image"])" alt="@item["name"]"  
  355.                 /></a></div>  
  356.                         }  
  357.                         <div class="name">  
  358.                             <href="@item["product_id"]">@item["name"]</a></div>  
  359.                         @if (item["price"] != null)  
  360.                         {  
  361.                             <div class="price">  
  362.                                 @Currency.format(item["price"].ToString(), null, null, true)  
  363.                             </div>  
  364.                         }  
  365.                         <onclick="addToCart('@item["product_id"]');" class="button"><span>Add to Cart</span></a></div>  
  366.                 }  
  367.             </div>  
  368.         </div>  
  369.                                                  }  
  370.                                                  if (ViewBag.tags != null)  
  371.                                                  {  
  372.         <div class="tags">  
  373.             <b>Tags:</b>  
  374.             @foreach (var item in ViewBag.tags)  
  375.             {  
  376.                 <href="@item["tag"]">@item["tag"]</a>  
  377.   
  378.             }  
  379.         </div>  
  380.                                                  }  
  381.     }  
  382. </div>  
  383. @*@Url.Action("Update", "Product");*@  
  384. @foreach (var item in ViewBag.Options)  
  385. {  
  386.     if (item.Key["type"] == "file")  
  387.     {  
  388.     <script type="text/javascript">  
  389.         new AjaxUpload('#button-option-option[@item.Key["product_option_id"]]', {  
  390.             action: '/Product/upload',  
  391.             name: 'file',  
  392.             autoSubmit: true,  
  393.             responseType: 'json',  
  394.             onSubmit: function (file, extension) {  
  395.                 $('#button-option-option[@item.Key["product_option_id"]]').after('<img src="catalog/view/theme/default/image/loading.gif" id="loading" style="padding-left: 5px;" />');  
  396.             },  
  397.             onComplete: function (file, json) {  
  398.                 $('.error').remove();  
  399.   
  400.                 if (json.success) {  
  401.                     alert(json.success);  
  402.   
  403.                     $('input[name=option[@item.Key["product_option_id"]]').attr('value', json.file);  
  404.                 }  
  405.   
  406.                 if (json.error) {  
  407.                     $('#option-@item.Key["product_option_id"]').after('<span class="error">' + json.error + '</span>');  
  408.                 }  
  409.   
  410.                 $('#loading').remove();  
  411.             }  
  412.         });  
  413.     </script>  
  414.     }  
  415. }  
  416. <script type="text/javascript">  
  417.     $('.fancybox').fancybox({ cyclic: true });  
  418. </script>  
  419. <script type="text/javascript">  
  420.     $('#tabs a').tabs();  
  421. </script>  
  422. <script type="text/javascript" src="@Url.Content("~/Content/Admin/js/jquery/ui/jquery-ui-timepicker-addon.js")"></script>  
  423. <script type="text/javascript"><!--  
  424.     if ($.browser.msie && $.browser.version == 6) {  
  425.         $('.date, .datetime, .time').bgIframe();  
  426.     }  
  427.     $('.date').datepicker({ dateFormat: 'yy-mm-dd' });  
  428.     $('.datetime').datetimepicker({  
  429.         dateFormat: 'yy-mm-dd',  
  430.         timeFormat: 'h:m'  
  431.     });  
  432.     $('.time').timepicker({ timeFormat: 'h:m' });  
  433.     //这行是重点  
  434.     $('#button-cart').bind('click', function () {  
  435.         //alert($('.product-info input[type=\'text\'], .product-info input[type=\'hidden\'], .product-info input[type=\'radio\']:checked, .product-info input[type=\'checkbox\']:checked, .product-info select, .product-info textarea'));  
  436.         $.ajax({  
  437.             url: '@Url.Action("Update", "Cart", new { area = "" })',  
  438.             type: 'post',  
  439.             data: $('.product-info input[type=\'text\'], .product-info input[type=\'hidden\'], .product-info input[type=\'radio\']:checked, .product-info input[type=\'checkbox\']:checked, .product-info select, .product-info textarea'),  
  440.             dataType: 'json',  
  441.             success: function (json) {  
  442.                 $('.success, .warning, .attention, information, .error').remove();  
  443.   
  444.                 if (json['warning']) {  
  445.   
  446.                     $('#notification').html('<div class="warning" style="display: none;">' + json['warning'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');  
  447.   
  448.                     $('.warning').fadeIn('slow');  
  449.   
  450.                 }  
  451.                 if (json['option_error']) {  
  452.                     for (i in json['option_error']) {  
  453.                         //alert(i);  
  454.                         $('#option-' + i).after('<span class="error">' + json['option_error'][i] + '</span>');  
  455.                     }  
  456.                 }  
  457.                 if (json['success']) {  
  458.                     //$('#notification').html('<div class="attention" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');  
  459.   
  460.                     //$('.attention').fadeIn('slow');  
  461.   
  462.                     //$('#cart_total').html(json['total']);  
  463.   
  464.                     //$('html, body').animate({ scrollTop: 0 }, 'slow');  
  465.   
  466.                 }  
  467.             }  
  468.         });  
  469.     });  
  470. //-->  
  471. </script>  

 后台端

C#代码  收藏代码
  1. [HttpPost]  
  2.         public JsonResult Update()  
  3.         {  
  4.             Dictionary<string, object> jsonMesg_dict = new Dictionary<string, object>();  
  5.   
  6.             ProductService pservice = new ProductService();  
  7.             SessionEntityService sessionService = new SessionEntityService();  
  8.             //Request.Params["××××"];是重点  
  9.             string product_id = Request.Params["product_id"];  
  10.             Dictionary<string, string> options = this.arrayFilterOption(Request.Params);  
  11.             string key = product_id + ":" + new OpenSharp.Storefront.Models.Tool.PHPSerializer().Serialize(options);  
  12.             Entity product = null;  
  13.   
  14.             if (product_id != null)  
  15.             {  
  16.                 int customer_group_id = 8;  
  17.                 product = pservice.getProduct(int.Parse(product_id), customer_group_id, languagedId);  
  18.             }  
  19.   
  20.             if (product != null)  
  21.             {  
  22.                 int product_total = 0;  
  23.                 int quantity = 1;  
  24.                 if (Request.Params["minimum"] != null)  
  25.                 {  
  26.                     quantity = int.Parse(Request.Params["minimum"]);  
  27.   
  28.                     SessionEntity session = sessionService.GetSessionEntity();  
  29.   
  30.                     ShopCart cartItem = session.ShopCart;  
  31.   
  32.                     foreach (KeyValuePair<string, ShopProduct> sp in cartItem.Items)  
  33.                     {  
  34.                         if (sp.Key.Equals(key))  
  35.                         {  
  36.                             product_total = sp.Value.Quantity;  
  37.                         }  
  38.                     }  
  39.   
  40.                     string str_error_json = string.Empty;  
  41.                     if (int.Parse(product["minimum"].ToString()) > (product_total + quantity))  
  42.                     {  
  43.                         str_error_json = string.Format("Minimum order amount for {0} is {1}!", product["name"], product["minimum"]);  
  44.                         jsonMesg_dict.Add("warning", str_error_json);  
  45.                     }  
  46.   
  47.                     Dictionary<Entity, Entities> poptions = pservice.getProductOptions(int.Parse(product_id), languagedId);  
  48.   
  49.                     Dictionary<string, string> dic_error_json = new Dictionary<string, string>();  
  50.                     jsonMesg_dict.Add("option_error", dic_error_json);  
  51.                     foreach (var item in poptions)  
  52.                     {  
  53.                         int optionID = int.Parse(item.Key["product_option_id"].ToString());  
  54.                         if (int.Parse(item.Key["required"].ToString()) == 1)  
  55.                         {  
  56.                             string str = "option[" + optionID + "]";  
  57.                             if (!options.ContainsKey(str) || (options[str] == null || options[str].Equals("")))  
  58.                             {  
  59.                                 string error_json = string.Format("{0} required!", item.Key["name"]);  
  60.                                 dic_error_json.Add(optionID.ToString(), error_json);  
  61.                             }  
  62.                         }  
  63.                     }  
  64.   
  65.                     if (jsonMesg_dict.Count == 0)  
  66.                     {  
  67.                         ShopProduct tempShoppingP = new ShopProduct();  
  68.                         tempShoppingP.ProductId = int.Parse(product_id);  
  69.                         tempShoppingP.Options = new OpenSharp.Storefront.Models.Tool.PHPSerializer().Serialize(options);  
  70.                         tempShoppingP.Quantity = quantity;  
  71.   
  72.                         //Please pay attention on the following line.  
  73.                         //                        if (product["special"] == null || product["special"] == "")  
  74.                         if (string.IsNullOrEmpty(product["special"].ToString()))  
  75.                         {  
  76.                             tempShoppingP.UnitPrice = double.Parse(product["price"].ToString());  
  77.                         }  
  78.                         else  
  79.                         {  
  80.                             tempShoppingP.UnitPrice = double.Parse(product["special"].ToString());  
  81.                         }  
  82.                         tempShoppingP.ItemCalculate();  
  83.   
  84.                         cartItem.Calculate(tempShoppingP);  
  85.   
  86.                         jsonMesg_dict.Add("success", product["name"].ToString());  
  87.                     }  
  88.                     else  
  89.                     {  
  90.                     }  
  91.                 }  
  92.             }  
  93.             return Json(jsonMesg_dict, JsonRequestBehavior.AllowGet);  
  94.         }  
posted @ 2014-09-11 14:13  super1234  阅读(688)  评论(0编辑  收藏  举报