asp.net';如果';运算符需要两个或三个操作数

asp.net';如果';运算符需要两个或三个操作数,asp.net,if-statement,Asp.net,If Statement,我写了一些代码来找出3个变量中最低的,然后显示出来,但我得到的是“'If'运算符需要两个或三个操作数。”我不确定问题是什么。如果您能提供帮助,我将不胜感激 <% dim HP_RegularPayment As Integer = HP_RegularPayment dim LPC_RegularPayment As Integer = LPC_RegularPayment dim PCP_Regular

我写了一些代码来找出3个变量中最低的,然后显示出来,但我得到的是“'If'运算符需要两个或三个操作数。”我不确定问题是什么。如果您能提供帮助,我将不胜感激

<%      

            dim HP_RegularPayment As Integer = HP_RegularPayment
            dim LPC_RegularPayment As Integer = LPC_RegularPayment
            dim PCP_RegularPayment As Integer = PCP_RegularPayment

            if HP_RegularPayment < LPC_RegularPayment and if HP_RegularPayment < PCP_RegularPayment then
                %>
                <div id="detailsprice" style="height:70px; padding-top:5px;"> 
                £<% if DiscountPrice.Text = "" then
                    Response.Write(DiscountPrice.Text) 
                else 
                    Response.Write(Price.Text)
                end if 
                %><br /> <span style="font-size:12px;">Or £<%Response.Write(HP_RegularPayment) %> Per Month With HP Finance</span> </div> <%

            else if LPC_RegularPayment < HP_RegularPayment and if LPC_RegularPayment < PCP_RegularPayment then
                %>
                <div id="detailsprice" style="height:70px; padding-top:5px;"> 
                £<% if DiscountPrice.Text = "" then
                    Response.Write(DiscountPrice.Text) 
                else 
                    Response.Write(Price.Text)
                end if 
                %><br /> <span style="font-size:12px;">Or £<%Response.Write(LPC_RegularPayment) %> 
                Per Month With LP Finance</span> </div> <%

            else if PCP_RegularPayment < HP_RegularPayment and if PCP_RegularPayment < LPC_RegularPayment then
                %>
                <div id="detailsprice" style="height:70px; padding-top:5px;"> 
                £<% if DiscountPrice.Text = "" then
                    Response.Write(DiscountPrice.Text) 
                else 
                    Response.Write(Price.Text)
                end if 
                %><br /> <span style="font-size:12px;">Or £<%Response.Write(PCP_RegularPayment) %> Per Month With PCP Finance</span> </div> <%
            else%>

            <div id="detailsprice"> 
                £<% if DiscountPrice.Text = "" then
                    Response.Write(DiscountPrice.Text) 
                else 
                    Response.Write(Price.Text)
                end if 

            end if%>

英镑
或HP Finance每月提供英镑 (
或 每月与LP财务部联系 英镑
或PCP财务部每月提供英镑 £
谢谢刘易斯,而不是

if HP_RegularPayment < LPC_RegularPayment and if HP_RegularPayment < PCP_RegularPayment then 
如果HP\u RegularPayment
使用

如果HP_RegularPayment
而不是

if HP_RegularPayment < LPC_RegularPayment and if HP_RegularPayment < PCP_RegularPayment then 
如果HP\u RegularPayment
使用

如果HP_RegularPayment
这是因为在每个现有的
if
语句中都有另一个
if

if HP_RegularPayment < LPC_RegularPayment and **if** HP_RegularPayment < PCP_RegularPayment then

我也同意@IrishChieftain在他的评论中的观点,即你应该真正地将你的代码和标记分开。

这是因为你在现有的
if
语句中有另一个
if

if HP_RegularPayment < LPC_RegularPayment and **if** HP_RegularPayment < PCP_RegularPayment then

我也同意@IrishChieftain的评论,你真的应该把你的代码和标记分开。

你需要把代码和标记分开。你的权利我应该但我没有时间做代码优先权这只是一个错误和肮脏的构建。你需要把你的代码和标记分开。你的权利我应该但我没有时间做代码优先权这只是一个错误和肮脏的构建肮脏的身材。