razor 约会时间

datetime.cshtml
<div class="col-1 input-title must">
	开课日期
</div>
<div class="col-2 input-content">
	<input type="text" id="ClassDateTimeFrom" name="ClassDateTimeFrom" class="form-control  datetimecontrol" placeholder="首次开课日期">
	<i class="fa fa-times datetimeCancel-detail" onclick="clearSingleTime('ClassDateTimeFrom')"></i>
</div>

razor 选择

select.cshtml
<div class="col-2 input-content">
	<select class="form-control select2control" id="SchoolId" name="SchoolId" onchange="setSchoolInfo()">
		<option value="">请选择</option>
		@foreach (tab_School school in (IEnumerable<tab_School>)ViewBag.Schools)
		{
			if (!string.IsNullOrWhiteSpace(Request["SchoolId"]))
			{
				if (Request["SchoolId"] == school.SchoolId.ToString())
				{
					<option value="@school.SchoolId" selected="selected" city="@school.City">@school.SimpleName</option>
					continue;
				}
			}
			<option value="@school.SchoolId" city="@school.City">@school.SimpleName</option>
		}
	</select>
</div>

razor 指数

indexall.cshtml
@using Auth.Arch
@using ManagePortal.Bll.Helper
@using ManagePortal.Common
@using ManagePortal.Model
@{
	ViewBag.Title = "现金流管理";
	Layout = "~/Views/Shared/_LayoutIndex.cshtml";
}

@section titleOperate
{
	<a class="btn btn-info btn-sm right" id="btnAdd">
		<i class="fa fa-plus"></i>添加
	</a>
	<script>
		$(function() {
			$("#btnAdd").bind("click",
				function() {
					window.open(`Create?schoolId=${$("#SchoolId").val()}`);
				});
		});
	</script>
}

@section toolbar
{
	@{ Html.RenderPartial("../Shared/SearchToolbar/SchoolId_all"); }
	<select class="form-control select2control" id="CashFlowItemTypeDicId" name="CashFlowItemTypeDicId">
		<option value="">所有类型</option>
		@{
			if (DicHelper.GetDic(null, EnumInfo.DicType.CashFlowItemType.ToString(), true, out List<tab_Dic> dics))
			{
				foreach (tab_Dic dic in dics)
				{
					<option value="@dic.DicId">@dic.Display</option>
				}
			}
		}
	</select>
	@{ Html.RenderPartial(TemplateHelper.Toolbar_ViewName_DateRange, TemplateHelper.BuildToolbarDateRange("PayDate", "发生日期")); }
	@{ Html.RenderPartial("../Shared/SearchToolbar/IsValid"); }
}

@section scripts
{
	<script>
		function initTable(tableObj) {
			tableObj.bootstrapTable({
				url: "../CashFlowItem/Index",
				@{ Html.RenderPartial("../Shared/_TableQueryParams"); }
				@{ Html.RenderPartial("../Shared/_TableParams"); }
				columns: [
					@{ Html.RenderPartial(TemplateHelper.Column_ViewName_Text, TemplateHelper.BuildText("SimpleName", "校区", TemplateHelper.Value_ClassTextLeft)); }
					@{ Html.RenderPartial(TemplateHelper.Column_ViewName_DateTime, TemplateHelper.BuildDateTime("PayDate", "发生日期", TemplateHelper.Value_Time_yyyyMMdd)); }
					@{ Html.RenderPartial(TemplateHelper.Column_ViewName_Decimal, TemplateHelper.BuildDecimal("Amount", "金额", TemplateHelper.Value_Num_Fix2)); }
					@{ Html.RenderPartial(TemplateHelper.Column_ViewName_DateTime, TemplateHelper.BuildDateTime("CreateTime", "录入日期", TemplateHelper.Value_Time_yyyyMMdd)); }
					@{ Html.RenderPartial(TemplateHelper.Column_ViewName_Text, TemplateHelper.BuildText("Note", "备注", TemplateHelper.Value_ClassTextLeft)); }
					@{ Html.RenderPartial("../Shared/TableColumns/IsValid"); }
					{
						field: 'DoSomething',
						title: '操作',
						cellStyle: function cellStyle(value, row, index, field) {
							return { classes: 'columnOp' };
						},
						formatter: function(value, row, index) {
							var temp = '';
							@if (BaseFunction.IsHaveSchoolDoPointOr(new[] {(int) EnumInfo.DoPoints.CashFlowItem_Delete, (int) EnumInfo.DoPoints.CashFlowItem_UnDelete}) || BaseFunction.IsHavePlatDoPointOr(new[] {(int) EnumInfo.DoPoints.CashFlowItem_Delete, (int) EnumInfo.DoPoints.CashFlowItem_UnDelete}))
							{
								<text>
									temp += row['IsValid'] ? table_op_delete : table_op_undelete;
								</text>
							}

							@if (BaseFunction.IsHaveSchoolDoPointOr(new[] {(int) EnumInfo.DoPoints.CashFlowItem_Edit}) || BaseFunction.IsHavePlatDoPointOr(new[] {(int) EnumInfo.DoPoints.CashFlowItem_Edit}))
							{
								<text>
									temp += table_op_edit;
								</text>
							}
							return temp;
						},
						events: Events
					},
				]
			});
		};

		window.Events = {
			'click .js-audit': function(e, value, row, index) {
				const keyId = row.CashFlowItemId;
				window.open(`Audit?ClassId=${keyId}`);
			},
			'click .js-edit': function(e, value, row, index) {
				const keyId = row.CashFlowItemId;
				window.open(`Edit?id=${keyId}`);
			},

			'click .js-delete': function(e, value, row, index) {
				var keyId = row.CashFlowItemId;
				$.jAlert({
					'type': 'confirm',
					'title': "确认",
					'confirmQuestion': "确认删除?",
					'theme': 'red',
					'size': 'md',
					'closeOnClick': true,
					'showAnimation': 'fadeInUp',
					'hideAnimation': 'fadeOutDown',
					'btns': [{ 'text': '关闭', 'theme': 'green' }],
					'onConfirm': function(e, btn) {
						e.preventDefault();
						$.post('delete',
							{
								Id: keyId
							},
							function(data) {
								const json = $.parseJSON(data);
								if (json.status === "1")
									refreshTable();
								else
									alertResultFail(json.msg);
							});
						return false;
					},
					'onDeny': '',
					'confirmAutofocus': 'denyBtn',
					'confirmBtnText': '&nbsp;&nbsp;&nbsp;&nbsp;删除&nbsp;&nbsp;&nbsp;&nbsp;',
					'denyBtnText': '&nbsp;&nbsp;&nbsp;&nbsp;取消&nbsp;&nbsp;&nbsp;&nbsp;'
				});
			},
			'click .js-undelete': function(e, value, row, index) {
				var keyId = row.CashFlowItemId;
				$.jAlert({
					'type': 'confirm',
					'title': "确认",
					'confirmQuestion': "确认恢复?",
					'theme': 'green',
					'size': 'md',
					'closeOnClick': true,
					'showAnimation': 'fadeInUp',
					'hideAnimation': 'fadeOutDown',
					'btns': [{ 'text': '关闭', 'theme': 'green' }],
					'onConfirm': function(e, btn) {
						e.preventDefault();
						$.post('undelete',
							{
								Id: keyId
							},
							function(data) {
								const json = $.parseJSON(data);
								if (json.status === "1")
									refreshTable();
								else
									alertResultFail(json.msg);
							});
						return false;
					},
					'onDeny': '',
					'confirmAutofocus': 'denyBtn',
					'confirmBtnText': '&nbsp;&nbsp;&nbsp;&nbsp;恢复&nbsp;&nbsp;&nbsp;&nbsp;',
					'denyBtnText': '&nbsp;&nbsp;&nbsp;&nbsp;取消&nbsp;&nbsp;&nbsp;&nbsp;'
				});
			},
		};
	</script>
}

razor 代码片段【ASP】

ASP代码片段收集。

xmymp--indes.asp
<%if Request.ServerVariables("SERVER_NAME")="www.meetasp.net" then
response.redirect "web1/index.htm"
else
response.redirect "web2/index.htm"
end if%>
域名自动指向程序
此ASP代码功能是当两个域名指向同一个虚拟主机时,可以自动指向对应的域名的网站
程序由MeetASP.net开发,如有任何技术问题,欢迎访问:www.meetasp.net

razor ToolbarTemplate

us.cshtml
@{Html.RenderPartial(TemplateHelper.Toolbar_Text, TemplateHelper.BuildToolbarText("TextbookName", "教材名称"));}

razor ParamsTemplate

pa.cshtml
@{ Html.RenderPartial("../Shared/_TableQueryParams"); }
@{ Html.RenderPartial("../Shared/_TableParams"); }

razor ColumnTemplate

text.cshtml
@{Html.RenderPartial(TemplateHelper.Column_ViewName_Text, TemplateHelper.BuildText("Subject", "学科", TemplateHelper.Value_ClassTextCenter));}
decimal.cshmtl
@{Html.RenderPartial(TemplateHelper.Column_ViewName_Decimal, TemplateHelper.BuildDecimal("Price", "价格", TemplateHelper.Value_Num_Fix2));}
Datetime.cshtml
@{Html.RenderPartial(TemplateHelper.Column_ViewName_DateTime, TemplateHelper.BuildDateTime("ValidDateTo", "有效期-结束", TemplateHelper.Value_Time_yyyyMMdd_tooltip));}
Decimal.cshtml
@{
	Html.RenderPartial("./TableColumns/Template/Decimal", new ViewDataDictionary
	{
		{
			TemplateHelper.ColumnField, "Price"
		},
		{
			TemplateHelper.ColumnTitle, "价格"
		},
		{
			TemplateHelper.FormatterDecimal, TemplateHelper.Value_Num_Fix2
		}
	});
}
DateTime.cshtml
@{
	Html.RenderPartial("./TableColumns/Template/DateTime", new ViewDataDictionary
	{
		{
			TemplateHelper.ColumnField, "ValidDateFrom"
		},
		{
			TemplateHelper.ColumnTitle, "有效期-起始"
		},
		{
			TemplateHelper.FormatterTime,TemplateHelper.Value_Time_yyyyMMdd_tooltip
		}
	});
}
text1.cshtml
@{
	Html.RenderPartial("./TableColumns/Template/Text", new ViewDataDictionary
	{
		{
			TemplateHelper.ColumnField, "ClassSpecific"
		},
		{
			TemplateHelper.ColumnTitle, "规格"
		},
		{
			TemplateHelper.CssContent, TemplateHelper.Value_ClassTextCenter
		},
		{
			TemplateHelper.FormatterContent, ""
		}
	});
}

razor

table.cshtml
<table class="table table-striped  table-bordered  table-hover table-sm">
  <thead>
      <tr>
          <th scope="col">#</th>
          <th scope="col">First</th>
          <th scope="col">Last</th>
          <th scope="col">Handle</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <th scope="row">1</th>
          <td>Mark</td>
          <td>Otto</td>
          <td></td>
      </tr>
      <tr>
          <th scope="row">2</th>
          <td>Jacob</td>
          <td>Thornton</td>
          <td></td>
      </tr>
      <tr>
          <th scope="row">3</th>
          <td>Larry</td>
          <td>the Bird</td>
          <td></td>
      </tr>
  </tbody>
</table>

razor InfoPart_Template

infopart.cshtml
<div class="infopart">
  <div class="col-12 infotitle">
      <h5>信息块一级标题</h5>
  </div>
  
  <div class="col-12 level2-title">
      <h5>
          信息块二级标题
      </h5>
  </div>
  <div class="level2-content">
      <div class="col-1 input-title">
          项
      </div>
      <div class="col-2 input-content">
          值
      </div>
      <div class="col-1 input-title">
          项
      </div>
      <div class="col-2 input-content">
          值
      </div>
      <div class="clearfix"></div>
  </div>
  
  <div class="col-12 level2-title">
      <h5>
          信息块二级标题
          <a target="_blank" class="font16 text-success" title="详细内容" href="#">
              <i class="fa fa-calendar" aria-hidden="true"></i>
          </a>
      </h5>
  </div>
</div>

razor Detail_Template

detail.cshtml
@{
    ViewBag.Title = "第一层级标题";
    Layout = "~/Views/Shared/_LayoutDetail.cshtml";
}

<form id="dataform">
  <input type="hidden" id="ClassTimeTable" name="ClassTimeTable">
  <input type="hidden" id="ClassTimeTableDisplay" name="ClassTimeTableDisplay">

  @*TODO:第二层级标题*@
  <div class="row level1-content animated zoomIn">
    <div class="col-12 level2-title">
        <h5>第二层级标题</h5>
    </div>

    <div class="level2-content">
        第二层级正文
    </div>
  </div>
</form>