码迷,mamicode.com
首页 > 其他好文 > 详细

coding

时间:2015-01-22 13:06:41      阅读:184      评论:0      收藏:0      [点我收藏+]

标签:

1:

@Html.DropDownList("dropDownList", Model.AvailableCates, T("Admin.Common.PeleseSelect").Text)

1:

static

var pros = typeof(SystemTemlNames).GetProperties();
combTemplsModel.AvailableCates.Clear();
foreach (var prop in pros)
{
var value = prop.GetValue(null, null).ToString();
var text = _localizationService.GetResource("Admin.Catalog.Products.CombTempls." + value);
combTemplsModel.AvailableCates.Add(new SelectListItem() { Value = value, Text = text });
}

1:

^\s*(?=\r?$)\n

1:

dr[13] == System.DBNull.Value
1:
.Replace("\r\n"," ")
1:
$.ajax({
cache: false,
type: "POST",
url: "@(Url.Action("CartAdd", "Product"))",
data: { "productId": productId, "PurchaseCount": v },
success: function (data) {
if (data == ‘success‘) {
alert("加入购物车成功!");
}
},
error: function (xhr, ajaxOptions, thrownError) {
}
});
1:

<td width="100%">
<input type="submit" id="btnAddNewCombTempls" name="btnAddNewCombTempls" value="@T("Admin.Catalog.Products.CombTempls.AddNew")" onclick="javascript:OpenWindow(‘@(Url.Action("CombTemplsPopup", "Product", new { productId = Model.Id, btnId = "btnRefresh_Combtempls", act = "btnAddNewCombTempls", formId = "product-form" }))‘, 860, 700, true); return false;" class="btn" />
<input type="submit" id="btnRefresh_Combtempls" name="btnRefresh_Combtempls" style="display: none" />
<script type="text/javascript">
$(document).ready(function () {
$(#btnRefresh_Combtempls).click(function () {
//refresh grid
var optionsGrid = $("#comb_templs-Grid");
optionsGrid.data(tGrid).ajaxRequest();

//return false to don‘t reload a page
return false;
});
});
</script>
</td>

2:

#region ChooseWinePopup
public ActionResult ChooseWinePopup(int productId)
{
var model = new CombTemplsPopupModel();
model.ProductId = productId;
return View(model);
}
[HttpPost]
[FormValueRequired("save")]
public ActionResult ChooseWinePopup(string btnId, string formId, string act, CombTemplsPopupModel model, int TemplId = 0)
{
ViewBag.RefreshPageFirst = true;
ViewBag.btnIdNext = btnId;
ViewBag.formIdNext = formId;
return View("ChooseWinePopup", null);
}
#endregion

3:

@using (Html.BeginForm())
{
//退出刷新
if (ViewBag.RefreshPageFirst == true)
{
<script type="text/javascript">
alert("‘@(ViewBag.RefreshPageFirst)‘");
try {window.opener.document.forms[@(ViewBag.formIdNext)].@(ViewBag.btnIdNext).click();}
catch (e){}
window.close();
</script>
}
<div class="section-header">
<div class="title">
@T("Admin.Catalog.Products.CombTempls.AddNew")
</div>
</div>
<div id="sub2Next" style="clear:both;">
<div class="adminData">
@*这里是:直接提交*@
<button type="submit" name="save" id="save" value="save" class="btn btn-primary"><i class="icon-ok icon-white"></i>&nbsp;@T("Admin.Common.Next")</button>
</div>
</div>
<script>
$(function () {

});
</script>
}

 

coding

标签:

原文地址:http://www.cnblogs.com/sonage/p/4241100.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!