ASP源代码:@{
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:
messag ...
ASP源代码:@{var price=25;}
html
body
if (price=30)
{
pThe price is high./p
}
else if (price20 price30)
{
pThe price is OK./p
}
else
{
pThe price is low./p
}
/body
/html运行结果 ...
ASP源代码:html
body
ul
@foreach (var x in Request.ServerVariables)
{li@x/li}
/ul
/body
/html运行结果:ALL_HTTPALL_RAWAPPL_MD_PATHAPPL_PHYSICAL_PATHAUTH_PASSWORDAUTH_TYPEAUTH_USERCERT_COOKIECERT_FLAGS ...
ASP源代码:!DOCTYPE html
html
body
@{
if (IsPost)
{
string companyname = Request;
string contactname = Request;
pYou entered: br
Company Name: @companyname br
Contact Name: @contactname /p
}
el ...
ASP源代码:html
body
@RenderPage(header.cshtml)
h1Hello Web Pages/h1
pThis is a paragraph/p
@RenderPage(footer.cshtml)
/body
/html运行结果:This is a header from a separate fileHello Web PagesThis is a ...