PHPからASP.netを使用してコードを変換しようとしました。C#.aspx Webフォームでフォーム応答を取得しようとしています
現在、フォームから投稿されたデータを取得するために、次のコードを試しています。
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CarPage.aspx.cs" Inherits="Ass2.CarPage"%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<%
If Request.Form["Car"] == "Volvo" then
header('Location:VolvoHomepage.html');End If
If Request.Form["Car"] == "Ford" then
header('Location:FordHomepage.html');End If
If Request.Form["Car"] == "Mercedes" then
header('Location:MercedesHomepage.html');End If
If Request.Form["Car"] == "Audi" then
header('Location:AudiHomepage.html');End If
If Request.Form["Car"] == "Vauxhall" then
header('Location:VauxhallHomepage.html');End If
%>
</body>
</html>
しかし、私は "/ 'アプリケーションでサーバーエラーを受けています。"
誰でも助けてください。
エラーの詳細をもっと詳しく説明する必要があります。完全なスタックトレースが必要です。それは何と言いますか?それは、ヘッダ( 'Location:MercedesHomepage.html');はPHPの構文であり、.NETではないからです。 Response.Redirect( "MercedesHomepage.html") '私は思うべきです。 – ADyson