By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,247 Members | 1,273 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,247 IT Pros & Developers. It's quick & easy.

Weird ASP Error

P: n/a
Hello people,

I am having a weird error and don't know what term to search in
google. Sorry to bother.

There is data in my field "M_BIO"

When I run this code <%=rslist.Fields.Item("M_bio").Value%>, it
displays the data, no problem.

When I used this code:
<% If rslist.Fields.Item("M_bio").Value <> "" then
response.Write("Testing")
End If %>

It displays 'testing', no probs.
But when I run this code:

<% If rslist.Fields.Item("M_bio").Value <> "" then
response.Write(rslist.Fields.Item("M_Bio").Value)
End IF %>

It displays nothing, the page shows no error. Does anyone know the
reason.
Help would be appreciated.
REgards
Roger
Jul 19 '05 #1
Share this Question
Share on Google+
11 Replies


P: n/a
What does this do?

<%
If rslist.Fields.Item("M_bio").Value <> "" then
response.Write(rslist.Fields.Item("M_Bio").Value)
Else
"Hmm empty value. Must be something else going on here."
End IF
%>

And do you have an On Error Resume Next in your code? If so, be sure you
comment it out while debugging.

Ray at work

"HelLind" <u8******@cc.nctu.edu.tw> wrote in message
news:9a**************************@posting.google.c om...
Hello people,

I am having a weird error and don't know what term to search in
google. Sorry to bother.

There is data in my field "M_BIO"

When I run this code <%=rslist.Fields.Item("M_bio").Value%>, it
displays the data, no problem.

When I used this code:
<% If rslist.Fields.Item("M_bio").Value <> "" then
response.Write("Testing")
End If %>

It displays 'testing', no probs.
But when I run this code:

<% If rslist.Fields.Item("M_bio").Value <> "" then
response.Write(rslist.Fields.Item("M_Bio").Value)
End IF %>

It displays nothing, the page shows no error. Does anyone know the
reason.
Help would be appreciated.
REgards
Roger

Jul 19 '05 #2

P: n/a
"HelLind" <u8******@cc.nctu.edu.tw> wrote in message
news:9a**************************@posting.google.c om...
Hello people,

I am having a weird error and don't know what term to search in
google. Sorry to bother.

There is data in my field "M_BIO"

When I run this code <%=rslist.Fields.Item("M_bio").Value%>, it
displays the data, no problem.

When I used this code:
<% If rslist.Fields.Item("M_bio").Value <> "" then
response.Write("Testing")
End If %>

It displays 'testing', no probs.
But when I run this code:

<% If rslist.Fields.Item("M_bio").Value <> "" then
response.Write(rslist.Fields.Item("M_Bio").Value)
End IF %>

It displays nothing, the page shows no error. Does anyone know the
reason.


I suspect it has a NULL value? Perhaps try this instead:

<% If Len(rslist.Fields.Item("M_bio").Value) > 0 Then
Response.Write("Testing")
End If
%>

Regards,
Peter Foti
Jul 19 '05 #3

P: n/a
On 15 Mar 2004 09:57:06 -0800, u8******@cc.nctu.edu.tw (HelLind)
wrote:
Hello people,

I am having a weird error and don't know what term to search in
google. Sorry to bother.

There is data in my field "M_BIO"

When I run this code <%=rslist.Fields.Item("M_bio").Value%>, it
displays the data, no problem.

When I used this code:
<% If rslist.Fields.Item("M_bio").Value <> "" then
response.Write("Testing")
End If %>

It displays 'testing', no probs.
But when I run this code:

<% If rslist.Fields.Item("M_bio").Value <> "" then
response.Write(rslist.Fields.Item("M_Bio").Valu e)
End IF %>

It displays nothing, the page shows no error. Does anyone know the
reason.


If it had a null value this would be expected. :)

Or I guess if it were a string of spaces. Have you tried debugging by
using Response.Writes in your IF/THEN segement? Something like:

<%
Response.Write rslist.Fields.Item("M_bio").Value & "<br>"
If rslist.Fields.Item("M_bio").Value <> "" then
Response.Write "Value is not empty<br>"
response.Write(rslist.Fields.Item("M_Bio").Value)
End IF
%>
Jul 19 '05 #4

P: n/a
What does this produce:

IF isNull(rslist.Fields.Item("M_bio").Value) THEN
response.write "Value is Null"
ELSE
response.write "Value is not Null
END IF

The field may contain Null which is not equivalent to ""
-----Original Message-----
"HelLind" <u8******@cc.nctu.edu.tw> wrote in message
news:9a**************************@posting.google. com...
Hello people,

I am having a weird error and don't know what term to search in google. Sorry to bother.

There is data in my field "M_BIO"

When I run this code <%=rslist.Fields.Item ("M_bio").Value%>, it displays the data, no problem.

When I used this code:
<% If rslist.Fields.Item("M_bio").Value <> "" then
response.Write("Testing")
End If %>

It displays 'testing', no probs.
But when I run this code:

<% If rslist.Fields.Item("M_bio").Value <> "" then
response.Write(rslist.Fields.Item("M_Bio").Value)
End IF %>

It displays nothing, the page shows no error. Does anyone know the reason.


I suspect it has a NULL value? Perhaps try this instead:

<% If Len(rslist.Fields.Item("M_bio").Value) > 0 Then
Response.Write("Testing")
End If
%>

Regards,
Peter Foti
.

Jul 19 '05 #5

P: n/a
"Jeff Cochran" wrote:
It displays nothing, the page shows no error. Does anyone
know the reason.


If it had a null value this would be expected. :)

Or I guess if it were a string of spaces...


For that matter, if you are viewing the output in a browser, the contents
could be viewable in the source but not displayed. I wonder how this turns
out:

Response.Write(Server.HTMLEncode(rslist.Fields.Ite m("M_bio").Value))
--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Jul 19 '05 #6

P: n/a
"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in message news:<e5**************@TK2MSFTNGP09.phx.gbl>...
What does this do?

<%
If rslist.Fields.Item("M_bio").Value <> "" then
response.Write(rslist.Fields.Item("M_Bio").Value)
Else
"Hmm empty value. Must be something else going on here."
End IF
%>

And do you have an On Error Resume Next in your code? If so, be sure you
comment it out while debugging.

There is no ON ERROR RESUME NEXT. I am using Ultradev code.

If i add ' Else Response.Write "hello" ' it doesnt' go to else. But If
i add 'response.write "hello' under the If statement, it does.

<%
If rslist.Fields.Item("M_bio").Value <> "" then
response.Write(rslist.Fields.Item("M_Bio").Value)
response.write "hello"
Else
'"Hmm empty value. Must be something else going on here."
response.write "test"
End IF
%>

It display "Hello" only. I F5 the page, even restarted the PC.

Thanks. :-)

Ray at work

"HelLind" <u8******@cc.nctu.edu.tw> wrote in message
news:9a**************************@posting.google.c om...
Hello people,

I am having a weird error and don't know what term to search in
google. Sorry to bother.

There is data in my field "M_BIO"

When I run this code <%=rslist.Fields.Item("M_bio").Value%>, it
displays the data, no problem.

When I used this code:
<% If rslist.Fields.Item("M_bio").Value <> "" then
response.Write("Testing")
End If %>

It displays 'testing', no probs.
But when I run this code:

<% If rslist.Fields.Item("M_bio").Value <> "" then
response.Write(rslist.Fields.Item("M_Bio").Value)
End IF %>

It displays nothing, the page shows no error. Does anyone know the
reason.
Help would be appreciated.
REgards
Roger

Jul 19 '05 #7

P: n/a
Perhaps you value is a space, which would not equal "" then.

<%
If rslist.Fields.Item("M_bio").Value <> "" then
response.Write "DATAHERE" & (rslist.Fields.Item("M_Bio").Value) &
"DATATHERE"
Else
'"Hmm empty value. Must be something else going on here."
response.write "test"
End IF
%>

What does that return?
DATAHEREDATATHERE or DATAHERE DATATHERE. (Look in view-source for real
value.)

Ray at work

"HelLind" <u8******@cc.nctu.edu.tw> wrote in message
news:9a*************************@posting.google.co m...
"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in

message news:<e5**************@TK2MSFTNGP09.phx.gbl>...
What does this do?

<%
If rslist.Fields.Item("M_bio").Value <> "" then
response.Write(rslist.Fields.Item("M_Bio").Value)
Else
"Hmm empty value. Must be something else going on here."
End IF
%>

And do you have an On Error Resume Next in your code? If so, be sure you comment it out while debugging.

There is no ON ERROR RESUME NEXT. I am using Ultradev code.

If i add ' Else Response.Write "hello" ' it doesnt' go to else. But If
i add 'response.write "hello' under the If statement, it does.

<%
If rslist.Fields.Item("M_bio").Value <> "" then
response.Write(rslist.Fields.Item("M_Bio").Value)
response.write "hello"
Else
'"Hmm empty value. Must be something else going on here."
response.write "test"
End IF
%>

It display "Hello" only. I F5 the page, even restarted the PC.

Thanks. :-)

Ray at work

"HelLind" <u8******@cc.nctu.edu.tw> wrote in message
news:9a**************************@posting.google.c om...
Hello people,

I am having a weird error and don't know what term to search in
google. Sorry to bother.

There is data in my field "M_BIO"

When I run this code <%=rslist.Fields.Item("M_bio").Value%>, it
displays the data, no problem.

When I used this code:
<% If rslist.Fields.Item("M_bio").Value <> "" then
response.Write("Testing")
End If %>

It displays 'testing', no probs.
But when I run this code:

<% If rslist.Fields.Item("M_bio").Value <> "" then
response.Write(rslist.Fields.Item("M_Bio").Value)
End IF %>

It displays nothing, the page shows no error. Does anyone know the
reason.
Help would be appreciated.
REgards
Roger

Jul 19 '05 #8

P: n/a
"Peter Foti" <pe***@Idontwantnostinkingemailfromyou.com> wrote in message news:<10*************@corp.supernews.com>...
"HelLind" <u8******@cc.nctu.edu.tw> wrote in message
news:9a**************************@posting.google.c om...
Hello people,

I am having a weird error and don't know what term to search in
google. Sorry to bother.

There is data in my field "M_BIO"

When I run this code <%=rslist.Fields.Item("M_bio").Value%>, it
displays the data, no problem.

When I used this code:
<% If rslist.Fields.Item("M_bio").Value <> "" then
response.Write("Testing")
End If %>

It displays 'testing', no probs.
But when I run this code:

<% If rslist.Fields.Item("M_bio").Value <> "" then
response.Write(rslist.Fields.Item("M_Bio").Value)
End IF %>

It displays nothing, the page shows no error. Does anyone know the
reason.


I suspect it has a NULL value? Perhaps try this instead:

<% If Len(rslist.Fields.Item("M_bio").Value) > 0 Then
Response.Write("Testing")
End If
%>

Regards,
Peter Foti


Hi peter,

There seems nothing wrong with the IF statement, it goes inside the IF
statement. So the len > 0 is passed.

It does display Response.write "testing" but not
response.Write(rslist.Fields.Item("M_Bio").Value)

Below is the code:

<% If len(rslist.Fields.Item("M_bio").Value) > 0 then
response.write "testing"
response.Write(rslist.Fields.Item("M_Bio").Value)
else
response.write "hello"
End IF %>

It shows "testing" only but not the "m_bio" data.

I dont' think anything wrong with the "M_BIO" field becoz direct

response.Write(rslist.Fields.Item("M_Bio").Value) works.
Basically my code is MM Ultradev's listdetail code.

Thanks
Jul 19 '05 #9

P: n/a
Try putting the value in a temp variable before the if statement. There is
an old old problem with memo fields that is resolved that way. Also, if the
value is NULL that is not the same as an empty string.
strBio = rslist.Fields.Item("M_bio").Value
If isnull(strBio) then strBio = ""
If strBio <> "" then
response.Write(strBio )
Else
"Hmm empty value. Must be something else going on here."
End IF
--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"HelLind" <u8******@cc.nctu.edu.tw> wrote in message
news:9a*************************@posting.google.co m...
"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in

message news:<e5**************@TK2MSFTNGP09.phx.gbl>...
What does this do?

<%
If rslist.Fields.Item("M_bio").Value <> "" then
response.Write(rslist.Fields.Item("M_Bio").Value)
Else
"Hmm empty value. Must be something else going on here."
End IF
%>

And do you have an On Error Resume Next in your code? If so, be sure you comment it out while debugging.

There is no ON ERROR RESUME NEXT. I am using Ultradev code.

If i add ' Else Response.Write "hello" ' it doesnt' go to else. But If
i add 'response.write "hello' under the If statement, it does.

<%
If rslist.Fields.Item("M_bio").Value <> "" then
response.Write(rslist.Fields.Item("M_Bio").Value)
response.write "hello"
Else
'"Hmm empty value. Must be something else going on here."
response.write "test"
End IF
%>

It display "Hello" only. I F5 the page, even restarted the PC.

Thanks. :-)

Ray at work

"HelLind" <u8******@cc.nctu.edu.tw> wrote in message
news:9a**************************@posting.google.c om...
Hello people,

I am having a weird error and don't know what term to search in
google. Sorry to bother.

There is data in my field "M_BIO"

When I run this code <%=rslist.Fields.Item("M_bio").Value%>, it
displays the data, no problem.

When I used this code:
<% If rslist.Fields.Item("M_bio").Value <> "" then
response.Write("Testing")
End If %>

It displays 'testing', no probs.
But when I run this code:

<% If rslist.Fields.Item("M_bio").Value <> "" then
response.Write(rslist.Fields.Item("M_Bio").Value)
End IF %>

It displays nothing, the page shows no error. Does anyone know the
reason.
Help would be appreciated.
REgards
Roger

Jul 19 '05 #10

P: n/a
"Dave Anderson" <GT**********@spammotel.com> wrote in message news:<eO**************@TK2MSFTNGP09.phx.gbl>...
"Jeff Cochran" wrote:
It displays nothing, the page shows no error. Does anyone
know the reason.


If it had a null value this would be expected. :)

Or I guess if it were a string of spaces...


For that matter, if you are viewing the output in a browser, the contents
could be viewable in the source but not displayed. I wonder how this turns
out:

Response.Write(Server.HTMLEncode(rslist.Fields.Ite m("M_bio").Value))


Sorry for all your troubles.

This is such a simple code and there is nothing wrong with it. I
uploaded to my webhost and it is working fine.

The weird thing is it still doesn't work in my PC's IIS. NO viruses,
winxp updated new. Is there any setting (buffer) to set ?

thanks
Jul 19 '05 #11

P: n/a


HI Roger ui think that the problem is in your file not in your page i
used this code:
<%if rstExcel.Fields.Item(I).Value <>"" then %>
<a href="servicios_diagnostico.asp?ciudad=<%response. write
rstExcel.Fields.Item(I).Value%>" >
<td class="contbb" onmouseover="className='contbc'"
onmouseout="className='contbb'" valign="middle">
<img height=15 src="graficos/pfeil.gif" width=10><% Response.Write
rstExcel.Fields.Item(I).Value %>
</td>
</a>
<%end if%>
and i didn't have problems.
If you wnat help why don't you post your file headers.
See u.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #12

This discussion thread is closed

Replies have been disabled for this discussion.