473,405 Members | 2,349 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

whats wrong with this function?

Can some please look at this function and maybe help me with why it's
not doing as it's told... :)

It's basicall meant to check to see if that field returned from
database actually has any data in it, and if not, return a display:none
style to hide it from the list

I'm trying to achieve not having to show every option of the columns in
that row, especially if the column is empty (no data)

Function code..
-----------------------
Function HideLink ( val )
If field.IsEmpty(val) then
response.write("display:none")
Else
response.write("")
End If
End Function
Use in page
----------------------

<a href="pdf/<%# Eval("content_type_msds") %>" <%# HideLink (
Container.DataItem("content_type_msds") )%>>MSDS</a>

Jul 31 '06 #1
7 1053
First of all, what type is val? Your function doesn't specify it as it is
required to do. Also, this shouldn't be a function unless it is going to
return something. For what you have, you need a Sub.

Lastly, I'm not sure that display:none is what you want. You'd need
STYLE="visibility:hidden" to hide something in the client, not just
display:none.

If val is just a string, then the Sub can be:

Sub HideLink (val As String)
If val ="" then
response.write("STYLE='visibility:hidden'")
Else
response.write("")
End If
End Sub


"Goldie" <go******@gmail.comwrote in message
news:11*********************@b28g2000cwb.googlegro ups.com...
Can some please look at this function and maybe help me with why it's
not doing as it's told... :)

It's basicall meant to check to see if that field returned from
database actually has any data in it, and if not, return a display:none
style to hide it from the list

I'm trying to achieve not having to show every option of the columns in
that row, especially if the column is empty (no data)

Function code..
-----------------------
Function HideLink ( val )
If field.IsEmpty(val) then
response.write("display:none")
Else
response.write("")
End If
End Function
Use in page
----------------------

<a href="pdf/<%# Eval("content_type_msds") %>" <%# HideLink (
Container.DataItem("content_type_msds") )%>>MSDS</a>

Jul 31 '06 #2
So do i need to define var as a string?
Scott M. wrote:
First of all, what type is val? Your function doesn't specify it as it is
required to do. Also, this shouldn't be a function unless it is going to
return something. For what you have, you need a Sub.

Lastly, I'm not sure that display:none is what you want. You'd need
STYLE="visibility:hidden" to hide something in the client, not just
display:none.

If val is just a string, then the Sub can be:

Sub HideLink (val As String)
If val ="" then
response.write("STYLE='visibility:hidden'")
Else
response.write("")
End If
End Sub


"Goldie" <go******@gmail.comwrote in message
news:11*********************@b28g2000cwb.googlegro ups.com...
Can some please look at this function and maybe help me with why it's
not doing as it's told... :)

It's basicall meant to check to see if that field returned from
database actually has any data in it, and if not, return a display:none
style to hide it from the list

I'm trying to achieve not having to show every option of the columns in
that row, especially if the column is empty (no data)

Function code..
-----------------------
Function HideLink ( val )
If field.IsEmpty(val) then
response.write("display:none")
Else
response.write("")
End If
End Function
Use in page
----------------------

<a href="pdf/<%# Eval("content_type_msds") %>" <%# HideLink (
Container.DataItem("content_type_msds") )%>>MSDS</a>
Aug 1 '06 #3
I don't know, what type is val returning?
"Goldie" <go******@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
So do i need to define var as a string?
Scott M. wrote:
>First of all, what type is val? Your function doesn't specify it as it
is
required to do. Also, this shouldn't be a function unless it is going to
return something. For what you have, you need a Sub.

Lastly, I'm not sure that display:none is what you want. You'd need
STYLE="visibility:hidden" to hide something in the client, not just
display:none.

If val is just a string, then the Sub can be:

Sub HideLink (val As String)
If val ="" then
response.write("STYLE='visibility:hidden'")
Else
response.write("")
End If
End Sub


"Goldie" <go******@gmail.comwrote in message
news:11*********************@b28g2000cwb.googlegr oups.com...
Can some please look at this function and maybe help me with why it's
not doing as it's told... :)

It's basicall meant to check to see if that field returned from
database actually has any data in it, and if not, return a display:none
style to hide it from the list

I'm trying to achieve not having to show every option of the columns in
that row, especially if the column is empty (no data)

Function code..
-----------------------
Function HideLink ( val )
If field.IsEmpty(val) then
response.write("display:none")
Else
response.write("")
End If
End Function
Use in page
----------------------

<a href="pdf/<%# Eval("content_type_msds") %>" <%# HideLink (
Container.DataItem("content_type_msds") )%>>MSDS</a>

Aug 1 '06 #4
Sorry, it should be a filename of a pdf (eg 1234.pdf)

Also tried implementing, but i got this error..

Overload resolution failed because no accessible 'ToString' can be
called with these arguments

and thanks for your help too!

Scott M. wrote:
I don't know, what type is val returning?
"Goldie" <go******@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
So do i need to define var as a string?
Scott M. wrote:
First of all, what type is val? Your function doesn't specify it as it
is
required to do. Also, this shouldn't be a function unless it is going to
return something. For what you have, you need a Sub.

Lastly, I'm not sure that display:none is what you want. You'd need
STYLE="visibility:hidden" to hide something in the client, not just
display:none.

If val is just a string, then the Sub can be:

Sub HideLink (val As String)
If val ="" then
response.write("STYLE='visibility:hidden'")
Else
response.write("")
End If
End Sub


"Goldie" <go******@gmail.comwrote in message
news:11*********************@b28g2000cwb.googlegro ups.com...
Can some please look at this function and maybe help me with why it's
not doing as it's told... :)

It's basicall meant to check to see if that field returned from
database actually has any data in it, and if not, return a display:none
style to hide it from the list

I'm trying to achieve not having to show every option of the columns in
that row, especially if the column is empty (no data)

Function code..
-----------------------
Function HideLink ( val )
If field.IsEmpty(val) then
response.write("display:none")
Else
response.write("")
End If
End Function
Use in page
----------------------

<a href="pdf/<%# Eval("content_type_msds") %>" <%# HideLink (
Container.DataItem("content_type_msds") )%>>MSDS</a>
Aug 1 '06 #5
Do i need to change the way i call it?
Instead of ..

<a href="pdf/<%# Eval("content_type_msds") %>" <%# HideLink (
Container.DataItem("content_type_msds") )%>>MSDS</a>

does it need to be presented some other way?

Goldie wrote:
Sorry, it should be a filename of a pdf (eg 1234.pdf)

Also tried implementing, but i got this error..

Overload resolution failed because no accessible 'ToString' can be
called with these arguments

and thanks for your help too!

Scott M. wrote:
I don't know, what type is val returning?
"Goldie" <go******@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
So do i need to define var as a string?
Scott M. wrote:
>First of all, what type is val? Your function doesn't specify it as it
>is
>required to do. Also, this shouldn't be a function unless it is going to
>return something. For what you have, you need a Sub.
>>
>Lastly, I'm not sure that display:none is what you want. You'd need
>STYLE="visibility:hidden" to hide something in the client, not just
>display:none.
>>
> If val is just a string, then the Sub can be:
>>
>Sub HideLink (val As String)
> If val ="" then
> response.write("STYLE='visibility:hidden'")
> Else
> response.write("")
> End If
>End Sub
>>
>>
>>
>>
>>
>>
>"Goldie" <go******@gmail.comwrote in message
>news:11*********************@b28g2000cwb.googlegr oups.com...
Can some please look at this function and maybe help me with why it's
not doing as it's told... :)
>
It's basicall meant to check to see if that field returned from
database actually has any data in it, and if not, return a display:none
style to hide it from the list
>
I'm trying to achieve not having to show every option of the columns in
that row, especially if the column is empty (no data)
>
Function code..
-----------------------
Function HideLink ( val )
If field.IsEmpty(val) then
response.write("display:none")
Else
response.write("")
End If
End Function
>
>
Use in page
----------------------
>
<a href="pdf/<%# Eval("content_type_msds") %>" <%# HideLink (
Container.DataItem("content_type_msds") )%>>MSDS</a>
>
>
Aug 1 '06 #6
Well, you haven't shown any code that uses the .ToString() method, so is
there more code you haven't provided here?
"Goldie" <go******@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
Sorry, it should be a filename of a pdf (eg 1234.pdf)

Also tried implementing, but i got this error..

Overload resolution failed because no accessible 'ToString' can be
called with these arguments

and thanks for your help too!

Scott M. wrote:
>I don't know, what type is val returning?
"Goldie" <go******@gmail.comwrote in message
news:11**********************@i42g2000cwa.googleg roups.com...
So do i need to define var as a string?
Scott M. wrote:
First of all, what type is val? Your function doesn't specify it as
it
is
required to do. Also, this shouldn't be a function unless it is going
to
return something. For what you have, you need a Sub.

Lastly, I'm not sure that display:none is what you want. You'd need
STYLE="visibility:hidden" to hide something in the client, not just
display:none.

If val is just a string, then the Sub can be:

Sub HideLink (val As String)
If val ="" then
response.write("STYLE='visibility:hidden'")
Else
response.write("")
End If
End Sub


"Goldie" <go******@gmail.comwrote in message
news:11*********************@b28g2000cwb.googlegr oups.com...
Can some please look at this function and maybe help me with why
it's
not doing as it's told... :)

It's basicall meant to check to see if that field returned from
database actually has any data in it, and if not, return a
display:none
style to hide it from the list

I'm trying to achieve not having to show every option of the columns
in
that row, especially if the column is empty (no data)

Function code..
-----------------------
Function HideLink ( val )
If field.IsEmpty(val) then
response.write("display:none")
Else
response.write("")
End If
End Function
Use in page
----------------------

<a href="pdf/<%# Eval("content_type_msds") %>" <%# HideLink (
Container.DataItem("content_type_msds") )%>>MSDS</a>


Aug 1 '06 #7
No, you call a function and a sub the same way, but functions must return a
value, sub can not return a value. Since your method doesn't produce a
return value, it should not be a function, it should be a sub.
"Goldie" <go******@gmail.comwrote in message
news:11*********************@p79g2000cwp.googlegro ups.com...
Do i need to change the way i call it?
Instead of ..

<a href="pdf/<%# Eval("content_type_msds") %>" <%# HideLink (
Container.DataItem("content_type_msds") )%>>MSDS</a>

does it need to be presented some other way?

Goldie wrote:
>Sorry, it should be a filename of a pdf (eg 1234.pdf)

Also tried implementing, but i got this error..

Overload resolution failed because no accessible 'ToString' can be
called with these arguments

and thanks for your help too!

Scott M. wrote:
I don't know, what type is val returning?
"Goldie" <go******@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
So do i need to define var as a string?
Scott M. wrote:
First of all, what type is val? Your function doesn't specify it as
it
is
required to do. Also, this shouldn't be a function unless it is
going to
return something. For what you have, you need a Sub.

Lastly, I'm not sure that display:none is what you want. You'd need
STYLE="visibility:hidden" to hide something in the client, not just
display:none.

If val is just a string, then the Sub can be:

Sub HideLink (val As String)
If val ="" then
response.write("STYLE='visibility:hidden'")
Else
response.write("")
End If
End Sub


"Goldie" <go******@gmail.comwrote in message
news:11*********************@b28g2000cwb.googlegr oups.com...
Can some please look at this function and maybe help me with why
it's
not doing as it's told... :)

It's basicall meant to check to see if that field returned from
database actually has any data in it, and if not, return a
display:none
style to hide it from the list

I'm trying to achieve not having to show every option of the
columns in
that row, especially if the column is empty (no data)

Function code..
-----------------------
Function HideLink ( val )
If field.IsEmpty(val) then
response.write("display:none")
Else
response.write("")
End If
End Function
Use in page
----------------------

<a href="pdf/<%# Eval("content_type_msds") %>" <%# HideLink (
Container.DataItem("content_type_msds") )%>>MSDS</a>


Aug 1 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Colin Steadman | last post by:
I have created a function to kill all session variables that aren't in a safe list. This is the function - Sub PurgeSessionVariables For Each Item In Session.Contents Select Case Trim(Item)...
2
by: Rasmus Grøndahl Olsen | last post by:
I have tried to write a wait function but it seems like it will not brake the while loop. I tried two different solutions. Can anyone tell me what I am doing wrong, and come with another...
3
by: Chris Geerdink | last post by:
combo with PHP. what is wrong with the Javascript? else { include("mysql.php"); $query1 = mysql_query("INSERT INTO gbook (naam, email, text) VALUES ('".$_POST."', '".$_POST."',...
1
by: Matthew Wilson | last post by:
I need to write a function crc(msg, len) that gets a char array of length len and then calculates the crc32 for the code. I don't understand what's going wrong in the code I have. It goes...
6
by: thesushant | last post by:
hi, whats the use of third argument to main( ), i.e. environmental parameters.... if i am not wrong ? 1st 1 is argc 2nd is argv and what bout the 3rd 1??????????? sushant
5
by: kernel.lover | last post by:
hello, I want to know if a fuction say malloc is declared as void *malloc() then whats the significance of void here. Does void * is used when function has the flexibility to return any type of...
7
by: Mike Barnard | last post by:
It's a simple test... VERY SIMPLE. But... In an external stlyesheet some attributes don't show. With the same styles cut and pasted to the test internally it works as expected. Anyone tell...
2
by: Nosferatum | last post by:
This script is meant to limit access by sessions, using username and password from mysql db and redirect users after login according to a given value belonging to each user in the db (10,20,30,40)....
10
by: joestevens232 | last post by:
Ok everything is good...I read in all my grades into each of the different arrays that they need to go in. Now Im trying to write a function that takes the grades and computes the average on a...
5
by: hiqu | last post by:
This issue is driving me nuts and not able to figure out whats wrong. I've this code in my firefox extension. Firefox always hangs and reports the script is busy. if I introduce a break...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.