条件response.write的问题 [英] problem with conditional response.write

查看:53
本文介绍了条件response.write的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好


当我检查数据库中是否有值时,我需要能够在屏幕上打印


< td> ;

<%if((Recordset1.Fields.Item(" profile1")。Value)<>

"")then response.Write" ; Pro1的<峰; br>" &

Recordset1.Fields.Item(" profile1")。Value%>


< / td>

我正在检查profile1是否包含任何文本,如果不打印任何内容。如果

是,那么打印标题和内容。

现在问题是我似乎无法检查值并打印相同的

价值。

如果我检查profile2而不是profile1(包含一个值)那么打印

profile1。

目前只有Pro1是写入屏幕但是

profile1的内容不是,尽管profile1不是空的。


可能出错了什么?


谢谢

Hi there

I need to be able to print on screen when I check if a value within a db

<td>
<% if ((Recordset1.Fields.Item("profile1").Value) <>
"") then response.Write"Pro1<br>" &
Recordset1.Fields.Item("profile1").Value%>

</td>

I am checking if profile1 contains any text if not don''t print anything. If
yes then print the heading and the contents .
Now the problem is that I cannot seem to check the value and print the same
value.
If I check profile2 instead of profile1 (which contains a value) then
profile1 is printed.
At the moment only Pro1 is written to the screen but the contents of
profile1 is not, eventhough profile1 is not empty.

What could be wrong ??

Thanks

推荐答案

现在我将从写作开始:

Response.Write Recordset1.Fields .Item(" Profile1")。value =""

以确保这不是一个空字符串。


如果不是,它可能是null或包含空格的字符串(特别是如果DB字段使用CHAR而不是VARCHAR,则为
)...


-

Patrice


" raj chahal" <在** @ digitise.info> écritdansle message de news:

%2 **************** @ TK2MSFTNGP14.phx.gbl ...
For now I would start by writing :
Response.Write Recordset1.Fields.Item("Profile1").value=""
to make sure this is not an empty string.

If not it could be null or a string that contains white spaces (especially
if the DB field uses CHAR instead of VARCHAR)...

--
Patrice

"raj chahal" <in**@digitise.info> a écrit dans le message de news:
%2****************@TK2MSFTNGP14.phx.gbl...
嗨那里

我需要能够在屏幕上打印,当我检查数据库中是否有值

< td>
<%if( (Recordset1.Fields.Item(" profile1")。Value)<>
"")然后response.Write" Pro1< br>" &
Recordset1.Fields.Item(" profile1")。Value%>

< / td>

我正在检查profile1是否包含任何内容文字,如果不打印任何东西。
如果
是,那么打印标题和内容。
现在问题是我似乎无法检查值并打印
相同
值。
如果我检查profile2而不是profile1(包含一个值),那么
profile1将被打印。
目前只有Pro1被写入屏幕但是
profile1的内容不是,虽然profile1不是空的。

有什么不对的?

谢谢
Hi there

I need to be able to print on screen when I check if a value within a db

<td>
<% if ((Recordset1.Fields.Item("profile1").Value) <>
"") then response.Write"Pro1<br>" &
Recordset1.Fields.Item("profile1").Value%>

</td>

I am checking if profile1 contains any text if not don''t print anything.
If
yes then print the heading and the contents .
Now the problem is that I cannot seem to check the value and print the
same
value.
If I check profile2 instead of profile1 (which contains a value) then
profile1 is printed.
At the moment only Pro1 is written to the screen but the contents of
profile1 is not, eventhough profile1 is not empty.

What could be wrong ??

Thanks


嗨没有emty字符串..

此外文本''Pro1''被写入屏幕意味着它的一部分执行

但不是Recordset1.Fields.Item(" profile1")。当前

周围的值位...


" raj查哈尔" <在** @ digitise.info>在留言中写道

新闻:%2 **************** @ TK2MSFTNGP14.phx.gbl ...
Hi there are no emty strings..
Also the text ''Pro1'' is written to screen meaning that part of it executes
but not the Recordset1.Fields.Item("profile1").Value bit in its current
surroundings..

"raj chahal" <in**@digitise.info> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
你好

当我检查数据库中是否有值时,我需要能够在屏幕上打印

< td>
<%if((Recordset1。 Fields.Item(" profile1")。Value)<>
"")然后response.Write" Pro1< br>" &
Recordset1.Fields.Item(" profile1")。Value%>

< / td>

我正在检查profile1是否包含任何内容文字,如果不是不打印任何东西。
如果是,则打印标题和内容。
现在问题是我似乎无法检查值并打印
相同的值。
如果我检查profile2而不是profile1(包含一个值)然后
profile1被打印。
目前只有Pro1被写入屏幕,但是
profile1的内容不是,尽管profile1不是空的。
谢谢
Hi there

I need to be able to print on screen when I check if a value within a db

<td>
<% if ((Recordset1.Fields.Item("profile1").Value) <>
"") then response.Write"Pro1<br>" &
Recordset1.Fields.Item("profile1").Value%>

</td>

I am checking if profile1 contains any text if not don''t print anything. If yes then print the heading and the contents .
Now the problem is that I cannot seem to check the value and print the same value.
If I check profile2 instead of profile1 (which contains a value) then
profile1 is printed.
At the moment only Pro1 is written to the screen but the contents of
profile1 is not, eventhough profile1 is not empty.

What could be wrong ??

Thanks



不确定这是不是回应我的建议。


我的意思是如果profile1持有 "它将打印Pro1(因为这

不是"),但你看不到任何可见的东西。同样地,如果值为

null并且如果我记得我的ASP日期很好,它将打印Pro1(因为这不是

"")但是你赢了''什么都看不到。


我真的会仔细检查。如果仍然无法打印这些值并向我们报告



Value<>"" ''它肯定会允许找出值

是否为空字符串

IsNull(Value)''它将允许查找是否为NULL

Len(Value)''它可以查找是否包含不可见的

字符


-

Patrice


" raj chahal" <在** @ digitise.info> écritdansle message de news:

%2 ****************** @ TK2MSFTNGP12.phx.gbl ...
Not sure if this is a response to my suggestion.

What I meant is that if profile1 holds " " it will print Pro1 (as this
is not "") but you won''t see anything visible. Similarly if the value is
null and if I remember well my ASP days, it will print Pro1 (as this is not
"") but you won''t see anything either.

I would really double check. If it still fails print those values and report
them to us :
Value<>"" '' It would definitely allows to find out if the value
is an empty string or not
IsNull(Value) '' It would allow to find is this is NULL
Len(Value) '' It would allow to find if it contains non visible
characters

--
Patrice

"raj chahal" <in**@digitise.info> a écrit dans le message de news:
%2******************@TK2MSFTNGP12.phx.gbl...
嗨没有emty字符串..
文本''Pro1''被写入屏幕意味着它的一部分执行
而不是Recordset1.Fields.Item(" profile1" )。当前
环境中的值位。

raj chahal <在** @ digitise.info>在消息中写道
新闻:%2 **************** @ TK2MSFTNGP14.phx.gbl ...
Hi there are no emty strings..
Also the text ''Pro1'' is written to screen meaning that part of it executes
but not the Recordset1.Fields.Item("profile1").Value bit in its current
surroundings..

"raj chahal" <in**@digitise.info> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
你好

当我检查数据库中是否有值时,我需要能够在屏幕上打印

< td>
<%if((Recordset1.Fields.Item( " profile1")。值)
<>
"")然后response.WritePro1< br>" &
Recordset1.Fields.Item(" profile1")。Value%>

< / td>

我正在检查profile1是否包含任何内容文本,如果不打印任何东西。
Hi there

I need to be able to print on screen when I check if a value within a db

<td>
<% if ((Recordset1.Fields.Item("profile1").Value)
<>
"") then response.Write"Pro1<br>" &
Recordset1.Fields.Item("profile1").Value%>

</td>

I am checking if profile1 contains any text if not don''t print anything.


如果

是然后打印标题和内容。
现在问题是我似乎无法检查值和打印
yes then print the heading and the contents .
Now the problem is that I cannot seem to check the value and print the


相同的

值。
如果我检查profile2而不是profile1(包含值),那么打印profile1。
目前只有Pro1被写入屏幕,但是
profile1的内容却没有,尽管profile1不是空的。

有什么不对的?

谢谢
value.
If I check profile2 instead of profile1 (which contains a value) then
profile1 is printed.
At the moment only Pro1 is written to the screen but the contents of
profile1 is not, eventhough profile1 is not empty.

What could be wrong ??

Thanks




这篇关于条件response.write的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆