C# 实例 Switch 条件
c# 实例
switch 条件
@{
var message="";
var weekday=datetime.now.dayofweek;
var day=weekday.tostring()
}
<html>
<body>
@switch(day)
{
case "monday":
message="this is the first weekday.";
break;
case "thursday":
message="only one day before weekend.";
break;
case "friday":
message="tomorrow is weekend!";
break;
default:
message="today is " + day;
break;
}
<p>@message</p>
</body>
</html>
相关文章
- ASP.NET Web Pages 布局
- ASP.NET Web Pages 类参考手册
- ASP.NET Web Pages WebSecurity 参考手册
- ASP.NET Razor VB 循环和数组
- ASP.NET MVC HTML 帮助器
- ASP.NET Web 页面
- ASP.NET ArrayList
- ASP.NET DataList 控件
- ASP.NET RegularExpressionValidator 控件
- ASP.NET Image 控件
- ASP.NET Panel 控件
- ASP.NET RadioButton 控件
- ASP.NET Style 控件
- WebSecurity GeneratePasswordResetToken 方法
- WebSecurity GetCreateDate 方法
- WebSecurity UserExists 方法
- HTML Inputbutton
- HTML Table 2
- ASP.NET HTML 控件 Button 2
- ASP.NET HTML 控件 Hyperlink