This topic is locked
[SOLVED]

 Button with code to go to hyperlink

5/6/2011 3:17:51 PM
ASPRunnerPro General questions
B
beachldy author

I have some code behind a BUTTON that should obtain driving directions from two form fields:
Dim Saddress, Eaddress, CompleteURL

If values("PickupAddress") <> null and values("DropOffAddress") <> null then

Saddress= values("PickUpAddress")

Eaddress = values("DropOffAddress")

CompleteURL ="http://maps.google.com/maps?saddr=Saddress&daddr=Eaddress";
(what to put here to make user go to the hyperlink automatically in a new browser tab?)
End If
I was wondering if this would work in html, but I'd have to get the variable 'CompleteURL' first!

<asp:Hyperlink Runat="server" NavigateUrl=CompleteURL onclick="window.open (this.href, 'popupwindow', 'width=400,height=400,scrollbars,resizable'); return false;">GET DRIVING DIRECTIONS<asp:Hyperlink>

Sergey Kornilov admin 5/6/2011

Button doesn't have access to field values. On the list page you can use 'View as' type 'Custom' to display this kind of link/button.
I highly recommend to check this article that explains the difference between buttons, code snippets and 'View as' Custom:

http://xlinesoft.com/blog/2011/04/28/taming-the-beast-events-buttons-and-code-snippets/

B
beachldy author 5/7/2011

I checked it out....Are the snippets in PHP (where not Javascript)?

Sergey Kornilov admin 5/7/2011

Those snippets are copy&paste from the manual. Here is the ASP manual related to 'View as' Custom:

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