This topic is locked
[SOLVED]

 passing ASPRunner record values (in dal) to external asp

3/10/2010 1:24:06 PM
ASPRunnerPro General questions
T
tone21705 author

Hi,
I have a created an ASPRunner list page, and it has 8 columns. The 8th column (Action) was added by me in Design Mode and has a code snippet to generate a link for each row in the ASPRunner table that has the data from that rows record (OriginalContentOwner and FormType) and pass it to an external ASP page.
I have tried this but get an error on data():



Response.Write("<a href='http://"'>http://"; & Session("HostServer") & "/UO/Web/Worklists/RiskManagement/assign.asp?UOLogNumber=" & Session("UOLogNumber") & "&OriginalContentOwner=" & data("OrignalContentOwner") & "&FormType=" & data("FormType") & ">Go!</a>")


Here is an shortened example of the table:
------------------------------------

OrignalContentOwner|FormType|Action|

------------------------------------

John Smith |StartForm| Go! |

------------------------------------

Mickey Mouse |EndForm | Go! |

------------------------------------

John Smith 2 |MidForm | Go! |

------------------------------------
If they click Go! for the first row I want this URL to be passed:



http://hostserver.com/UO/Web/Worklists/RiskManagement/assign.asp?UOLogNumber=75&OriginalContentOwner=John%20Smith&FormType=StartForm



and if they click row 2 the data will change accordingly.
The only way I have been able to do this is leave the code snippet ending at



Response.Write("<a href='http://"'>http://"; & Session("HostServer") & "/UO/Web/Worklists/RiskManagement/assign.asp?UOLogNumber=" & Session("UOLogNumber") & "&OriginalContentOwner=")



and going into templates/vw_ControlPage_list.htm and adding

<TD>{$event vw_ControlPage_Snippet1}{$OriginalContentOwner_value}&FormType={$FormType_value}'>GO!</a></TD>


Obviously if I or anyone else ever rebuilt the project they would have to do the same, and it makes it a huge pain.
Any other way to do this? I noticed
data("OriginalContentOwner") but I got an ASP error. Maybe I need to define data() as an object of dal.something? It seems that {$OriginalContentOwner_value} is processed after the ASP, but I am unsure.
Thanks so much,
Antoni

Sergey Kornilov admin 3/11/2010

Code snippet doesn't have access to underlying page data. I would suggest to add new dummy column to the SQL query and set 'View as' type of this column to 'Custom'.
select ...

field1,

field2,

0 as dummyfield

from ...
Examples of accessing data from custom code:

http://xlinesoft.com/asprunnerpro/docs/_view_as__settings_custom.htm

T
tone21705 author 3/18/2010

Worked perfectly. Thanks for everything!