-1

在以下情况下,我试图将“E”值移动到 BillMeType 变量,但它不起作用。

<% if TransactionGateway = "" then %>
<% BillMeType = "E" %>
<% end if %>
4

2 回答 2

1

唯一BillMeType不能设置为“E”的方法(使用您的代码示例)是如果TransactionGateway不等于空字符串。TransactionGateway可能看起来是一个空字符串 - 即NULL吗?

此外,如果您仍在代码块中,则无需进行所有上下文切换。您的代码可以重写为:

<% 
If TransactionGateway = "" Then
  BillMeType = "E"
End If 
%>

恕我直言,这更具可读性。

另外,我编辑了你的标题。ASP.NET 和 ASP Classic 是两个完全不同的东西。“经典”一词源于此版本的 ASP 是 .NET 之前的版本。ASP Classic(通常)是用 VBScript 编写的,而 .NET 是用 CLR 语言(C#、VB.NET 等)编写的。一世

于 2012-08-22T14:05:18.223 回答
0

您可以使用

<% If TransactionGateway = "" Then BillMeType = "E" End If cstr(BillMeType) response.Write(BillMeType)%>

于 2012-08-27T11:05:04.693 回答