简单教程
提交运行
代码编辑器:
<!DOCTYPE html> <meta charset="utf-8" /> @{ 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=""> <p>Company Name:</p> <p><input type="text" name="CompanyName" value="" /></p> <p>Contact Name:</p> <p><input type="text" name="ContactName" value="" /></p> <p><input type="submit" value="Submit" class="submit" /></p> </form>}}
运行结果: