This topic is locked

Creating a hyperlink on a ASPRunner generated page

2/4/2004 7:43:34 PM
ASPRunnerPro General questions
G
Gnat author

Using various tools, I have created a homegrown, real-time event log monitoring utility, and thanks to ASPRunner, I have a web front-end to query the events that are in my SQL database. What I would like to do now is make a modification to the ASP code to have the Event ID be a hyperlink to the corresponding page at eventid.net. The hyperlink would need to be something like <a target=_blank href=http://www.eventid.net/display.asp?eventid=MsgError&source=MsgSource>;. What info do you need to be able to help me out?
Thanx

Sergey Kornilov admin 2/4/2004

Hi,
open ..._list.asp file in text editor and find section of code that displays EventID field:

<%

if IsBinaryField(rsData.Fields("EventID")) then

  Response.Write CreateImageControl(rsData, "EventID")

else

  Response.Write ProcessLargeText(GetData(rsData.Fields("EventID"), ""))

end if

%>


Change it to something like this:

<%

  Response.Write "<a target=_blank href=http://www.eventid.net/display.asp?eventid="; & GetData(rsData.Fields("EventID"), "")) & "&source=MsgSource>"

%>


I hope this helps.

G
Gnat author 2/5/2004

I have tried your posted suggestion, but I receive the following error:
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/ApplicationLogs/ApplicationLogEntry_list.asp, line 722
Response.Write "<a target=_blank href=http://www.eventid.net/display.asp?eventid="; & GetData(rsData.Fields("MsgError"), "")) & "&source=MsgSource>"

---------------------------------------------------------------------------------------------------------------------------^
Any other suggestion.

Sergey Kornilov admin 2/5/2004

Seems to be an error in my code. Try this:

<%

  Response.Write "<a target=_blank href=http://www.eventid.net/display.asp?eventid="; & GetData(rsData.Fields("EventID"), "") & "&source=MsgSource>"

%>


Btw, what you like to put to MsgSource parameter?

G
Gnat author 2/5/2004

Since we have recently purchased the ASPRunner app with support, I am sending you the code and example data in a zip file via email.
Thanx for your help.

G
Gnat author 2/6/2004

<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=1051&image=1&table=forumreplies' class='bbc_emoticon' alt=':lol:' /> Just so everyone knows, Sergey came thru for me. I wanted to post the final code here so that everyone may benefit.

<%

Response.write "<a target=blank href=http://www.eventid.net/display.asp?eventid="; &

Server.URLEncode(GetData(rsData.Fields("MsgError"), "")) & _

"&source=" & Server.URLEncode(GetData(rsData.Fields("MsgSource"), "")) & ">" & GetData(rsData.Fields("MsgError"), "") & "</a>"
%>


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