This topic is locked

Adding and Email Link

10/17/2006 1:34:11 PM
ASPRunnerPro General questions
B
bburden author

<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=3614&image=1&table=forumtopics' class='bbc_emoticon' alt=':angry:' /> I have seen the below script in several post in this site, I have worked with this for over a week with no avail. I know I am putting it in the right place in the ....list.asp page but it just does not work. I dont't expect for anyone to do my work for me just tell me if I am putting it in the wrong place. The only difference I can see in some of the post here is that rs.DataFields is used instead of rs.Fields which is used in ASPRunner 4.0. But if I use rs.DataFields I get a error message.
<%
THIS IS THE ORIGIANL TEXT.
if IsBinaryField(rs.Fields("emailto")) or Format("emailto")=FORMAT_DATABASE_FILE then

Response.Write CreateImageControl(rs, "emailto", "")

else

strData = GetData(rs.Fields("emailto"), "")
if Format("emailto")<>FORMAT_HTML then

Response.Write ProcessLargeText(strData,"picfield=" & Server.URLEncode("emailto") & "&where=" & Server.URLEncode(strImageWhere),"",MODE_LIST)

else

Response.Write strData

end if
end if

%>
Everytime I replace the above text with this one it adds the email link and it opens Outlook just fine, but the Search feature and the go to next page numbers at the botton of the page no longer works on the list page. I know this shouldn't effect this function, but it does. If this is not the best way, I do need a way to add a email link to the list page.
Please help me.
THIS IS THE REPLACEMENT TEXT

<%

if IsBinaryField(rs.Fields("emailto")) or Format("emailto")=FORMAT_DATABASE_FILE then

Response.Write CreateImageControl(rs, "emailto", "")
strData = GetData(rs.Fields("emailto"), "HTML") ("tkt_id", "cust_email", "cc_manager_email", "cost_center_tkt", "cc_manager_tkt", "first_name_cust", "last_name_cust", "service_issue","service_tkt_status")
else
Response.write "<a href=""mailto:" & GetData(rs.Fields("emailto"),"")& "&cc=" & GetData(rs.Fields("email_cust"), "")& "," &GetData(rs.Fields("cc_manager_email"), "") & "?subject=Service Ticket # " & GetData(rs.Fields("tkt_id"), "") & "&body=This ticket may be charged to your cost center. Cost Center manager please reply to this email for your approval. Please go to http://xxxxxx.xxx.xx.com to veiw ticket #" &" "& GetData(rs.Fields("tktid"), "")&"."& +"%0D%0A"+"%0D%0A" &

"Customer: "&GetData(rs.Fields("first_name_cust"), "")& " " &GetData(rs.Fields("last_namecust"), "")+"%0D%0A" +"%0D%0A" &

"Cost Center Manager: "& GetData(rs.Fields("cc_managertkt"), "")+"%0D%0A" +"%0D%0A" &

"Cost Center: "& GetData(rs.Fields("cost_centertkt"), "")+"%0D%0A" +"%0D%0A" &

"Service Issue: "& GetData(rs.Fields("serviceissue"), "")+"%0D%0A" +"%0D%0A" &

"Service Ticket Status:" & GetData(rs.Fields("service_tkt_status"), "")& """>Click to send record info!</a>"
end if
%>

Sergey Kornilov admin 10/17/2006

You putting it in the right place.
What editor you use to modify ASP code? Maybe your editor breaks some formatting?
I would remove everything in new code except Response.Write statement first.

Put a simple Response.Write "Hello word" there to see if it works and don't break the search function.

Add one line of your code and run a test again. Keep doing this until you find a piece that breaks ASP page.

B
bburden author 10/17/2006

Thank you so very much for your reply, I just needed to know if I was putting it in the right place, I am using FrontPage 2002 as my editor, but what is so strange is that this very same code works on my laptop which I am running office and Windows XP. But on my desk top at work which I am running Windows XP and office 2003 it does not work at all after I put the code in the ...list page.
But I will do as you suggest and put in one line at a time, to see where the code actually break and let you know, I will also go to another machine on tomorrow at work that is not running 2003 and see if that may be a factor, but nevertheless I will like you know.
Again thank you for all your help Sergey.

Sergey Kornilov admin 10/18/2006

Just a side note - Frontpage breaks ASP/HTML/Javascript code sometimes.

Use a plain text editor like Notepad or Notepad++ or Homesite to edit ASP files.

B
bburden author 10/18/2006

<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=11938&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' /> Sergey, After I had gone on 2 other machine in my office, and downloaded an unregisted copy of of ASPRunner 4 and then place the code in the ....list.asp and got it to work, I really got frustrated. And just wanted to throw in the towel.
But then I got your side note, about changing editors I did and it worked, after all this time it was the editor, but the reason I did not think about it is because all the other modification I have done worked fine with front page editor.
But anyway thank you as always for your expertise.

<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=11938&image=2&table=forumreplies' class='bbc_emoticon' alt=':lol:' />