如下内容段是关于ASP.NET Razor简单的表单提交处理的内容。
<!DOCTYPE html>
<html>
<body> br/>@{
if (IsPost)
{
string companyname = Request["CompanyName"];
string contactname = Request["ContactName"];
<p>You entered: <br>
Company Name: @companyname <br>
Contact Name: @contactname </p>
}
else
{
<form method="post" action="">
Company Name:<br>
<input type="text" name="CompanyName" value=""><br>
Contact Name:<br><br>
<input type="text" name="ContactName" value=""><br><br>
<input type="submit" value="Submit" class="submit">
</form>
}
}
</body>
</html>
©著作权归作者所有:来自51CTO博客作者ebsdg的原创作品,如需转载,请注明出处,否则将追究法律责任