Geary
|
Posted: 11/06/2003, 6:46 AM |
|
Anyone know how i can show or hide the URL link on a grid list page based on if a website or email address was entered into the database when the record was created?
Currently, the link shows up regardless if the website or email was entered...
I'm using Codecharge 2.0, ASP w/ templates
TIA
Geary
|
|
|
Hamilton
|
Posted: 11/06/2003, 7:31 PM |
|
The easiest way to perform this is to change the link to a label control.
In the Before_Show event do the following;
Dim lngRecordID
Dim sWebsite
Dim sEmail
Dim sResult
lngRecordID = Users.DataSource.Recordset.Fields("user_id")
sWebsite = Users.DataSource.Recordset.Fields("Website")
sEmail = Users.DataSource.Recordset.Fields("Email")
If Len(sWebsite) > 0 then sResult = sWebsite
If Len(sEmail) > 0 Then sResult = sEmail
'Or modify this to accomdate if the user provided both
If Len(sWebsite) > 0 AND Len(sEmail) > 0 Then
sResult = sWebsite & "<BR>" & sEmail
End If
Users.lblEContact.value = sResult
Hamilton
www.dataobjx.net
|
|
|
|