0

何らかの理由で、インクルードがifステートメント内にある場合、それは機能します。私は得る

500内部サーバーエラー。探しているリソースに問題があり、表示できません。

ただし、同じ行を外側に含めると、正しくレンダリングされ、フォームが表示されます。私は何かが足りないのですか?

<% elseif EmailError <> "?" then %>
                <p class="StdParaHead">Can't Send Message</p>
                <p style="color:red;font-weight:bold">Please fill in
                <%if EmailError="NameBlank" then
                    Response.Write "your name"
                ElseIf EmailError = "EmailBlank" OR EmailError = "InvalidEmail" then
                    Response.Write "a valid e-mail address"
                ElseIf EmailError = "LocationBlank" then
                    Response.Write "your City and State"
                ElseIf EmailError = "BadSecurity" then
                    Response.Write "the proper security information"
                End if
                %></p>
                <p>clause1 </p>
<!--#include virtual="/includes/Content/ContactFormNew.inc"--> /* does not work here */

    <% else %>
                <p class="StdParaHead">Sorry...</p>
                <p>Due to an uncertain error, your message could not be sent at this time. Please see our <a href="contact.asp">contact information</a> for other ways to contact Axiom Valuation Solutions, or try again later.</p>
                <p><a href="/newlook/newsite/default.asp">Home</a></p>
                <p> CLAUSE 2</p>
<!--#include virtual="/includes/Content/ContactFormNew.inc"--> /* does not work */
    <%end if%>
<!--#include virtual="/includes/Content/ContactFormNew.inc"--> /* works here */
4

1 に答える 1

0

したがって、「ContactFormNew.inc」でいくつかの変数を定義することをお勧めします。

ファイルを実行しようとしているように「動的に」ファイルを含めることはできないため、ファイルは2回含まれます。

これは、ASP コードが解釈される前にインクルードが実行され、"ContactFormNew.inc" のコンテンツが 2 回 (elseif end else ブロックで) 挿入されるためです。

そのため、ファイルが2回含まれているため、同じ変数を2回定義したことでエラーが発生します...

于 2012-04-19T09:51:34.037 に答える