@{
var imagePath="";
if( Request["Choice"] != null)
{imagePath="images/" + Request["Choice"];}
}
<!DOCTYPE html>
<html>
<body>
<h1>显示图像</h1>
<form method="post" action="">
我想看
<select name="Choice">
<option value="Pic1.jpg">照片 1</option>
<option value="Pic2.jpg">照片 2</option>
<option value="Pic3.jpg">照片 3</option>
</select>
<input type="submit" value="提交">
@if(imagePath != "")
{
<p>
<img src="@imagePath" alt="示例">
</p>
}
</form>
</body>
</html>