Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Display field as a hyperlink
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

dava133
Starting Member

United Kingdom
9 Posts

Posted - 26 February 2002 :  18:13:19  Show Profile  Send dava133 an AOL message
I need to disply a field from a database as a hyperlink. The field is fldEmail and i would like the link to be mailto:<fldEmail>. It is displayed as a label at the moment.

I was thinking something like this would work:

fldEmail="<a href="mailto:fldEmail">fldEmail</a>

but it doesnt, can someone point me in the right direction to correct this, cheers

David

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 26 February 2002 :  19:01:32  Show Profile  Send ruirib a Yahoo! Message
quote:

I need to disply a field from a database as a hyperlink. The field is fldEmail and i would like the link to be mailto:<fldEmail>. It is displayed as a label at the moment.

I was thinking something like this would work:

fldEmail="<a href="mailto:fldEmail">fldEmail</a>

but it doesnt, can someone point me in the right direction to correct this, cheers

David



You can use something like this, admiting that rs("YourField") has the value you want:

strField = "<a href=""mailto:" & rs("YourField") & """>" & rs("YourField") & "</a>"


Go to Top of Page

dava133
Starting Member

United Kingdom
9 Posts

Posted - 26 February 2002 :  20:18:26  Show Profile  Send dava133 an AOL message
Right just tried that and didnt work, I am a complete newbie to ASP and I am using a program called code charge so trying to add this code in the beforeshow section, can you explain the rs and the str at the beginning? cheers

David
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 26 February 2002 :  20:38:21  Show Profile  Send ruirib a Yahoo! Message
quote:

Right just tried that and didnt work, I am a complete newbie to ASP and I am using a program called code charge so trying to add this code in the beforeshow section, can you explain the rs and the str at the beginning? cheers

David



If you are reading the field from a database you are using a recordset object to "store" the values read from the database, aren't you?. I'm supposing that rs is the recordset object variable where you keep the records read from the database.

Also strField is just a variable where you store the HTML before outputing it using Response.Write, as in

<%Response.Write strField %>

Have I made myself clear this time?

Go to Top of Page

dava133
Starting Member

United Kingdom
9 Posts

Posted - 26 February 2002 :  21:24:56  Show Profile  Send dava133 an AOL message
Im sure u were clear the first time im just not very good at this yet so didnt understand well, and Im still not sure but ill have a play and see what happens! The text the the program generates seems to be a bit different to what your saying and I think thats why Im getting confused! cheers

David
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 26 February 2002 :  21:31:34  Show Profile  Send ruirib a Yahoo! Message
quote:

Im sure u were clear the first time im just not very good at this yet so didnt understand well, and Im still not sure but ill have a play and see what happens! The text the the program generates seems to be a bit different to what your saying and I think thats why Im getting confused! cheers

David



David do you have the code reading the value from the database? Do you want to show it here (only if it's not too many lines, otherwise write as a txt file and provide a link to it, please)? That way I can see how we can change it to do what you want...

Go to Top of Page

dava133
Starting Member

United Kingdom
9 Posts

Posted - 26 February 2002 :  21:42:04  Show Profile  Send dava133 an AOL message
here u go m8 :

http://homepage.ntlworld.com/dava133/UserRecord.txt

appreciate the help,

David
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 26 February 2002 :  21:52:03  Show Profile  Send ruirib a Yahoo! Message
Sorry David, it's not enough for me to understand what's going on.

Can you please do something similiar with the other 2 ASP files: common.asp, header.asp.

A question: you are relying entirely on this automatically generaded code, right?



Edited by - ruirib on 26 February 2002 21:53:00
Go to Top of Page

dava133
Starting Member

United Kingdom
9 Posts

Posted - 26 February 2002 :  21:56:03  Show Profile  Send dava133 an AOL message
Yeah I am, this bit of code im looking to add now, is like extra. Ive done the same with the other 2 files Header.txt and Common.txt, but dont think header is relevant as its only a navigation bar really, if u can run it locally ill send u the whole site if that will help, cheers


David

Edited by - dava133 on 26 February 2002 21:56:47
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 26 February 2002 :  21:59:43  Show Profile  Send ruirib a Yahoo! Message
Emailing me the site would be good, but I would need the database also. Is that a test database?

Go to Top of Page

dava133
Starting Member

United Kingdom
9 Posts

Posted - 26 February 2002 :  22:04:10  Show Profile  Send dava133 an AOL message
yeah it is so that doesnt bother me, where u want me to send it m8?

David
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 26 February 2002 :  22:04:29  Show Profile  Send ruirib a Yahoo! Message
David,

replace line 287 in your UserRecord.asp by this one:

SetVar "Email", "<a href=""mailto:" & fldEmail & """>" & fldEmail & "</a>"

Then try it to see if it works...

Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 26 February 2002 :  22:06:33  Show Profile  Send ruirib a Yahoo! Message
Try my previous recomendation.
If it doesn't work send everything to ruirib@computer.org.

Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 26 February 2002 :  22:12:14  Show Profile  Send ruirib a Yahoo! Message
quote:

Lol can u give me a hint where that line is! I dont have any fancy text editors and counting that many lines might take me a while!!

David


It's in the bottom 20 lines. You'll find several lines beginning with SetVar...

Go to Top of Page

dava133
Starting Member

United Kingdom
9 Posts

Posted - 26 February 2002 :  22:13:17  Show Profile  Send dava133 an AOL message
Worked a treat m8 thanks a lot!! lol onto my next problem..!!

David
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 26 February 2002 :  22:16:39  Show Profile  Send ruirib a Yahoo! Message
quote:

Worked a treat m8 thanks a lot!! lol onto my next problem..!!

David



You're welcome. I'm glad I could help

But you are in for a major fun. Trying to figure out some auto generated code with a simple tool like a text editor that will not even let you find in which line number you're in...

Enjoy it .

Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.6 seconds. Powered By: Snitz Forums 2000 Version 3.4.07