I have a page that I have created with a gridview.
I am taking the values from a column and creating a URL out of them.
I have a button on the page that, when clicked, should open a new browser window with the URL I created in the page.
I have tried this a few different ways with out much success. If I place the URL builder in the ASP page, I don’t seem to be able to call the sub automatically so that the URL is built before the user clicks on a button.
If I set the button to run the sub, I can’t get a new window opened with the URL from the sub.
If I move all of the vb to the asp.vb page in the onload event, it no longer can see the gridview to build my URL.
Here is what I have at the moment, the page renders but I am missing a way to navigate to the URL….
[code]
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
Public Sub BuildURL() Dim index As Integer = AssignedGridView.Rows.Count
Dim BaseURL As String = "http://10.4.1.251/mappy/getmap.php?"
Dim FullURL As String
Dim Iteration As String
Dim i As Integer
FullURL = BaseURL
For i = 1 To index
If i = 1 Then
Iteration = "Site"
Else : Iteration = "&Site"
End If
FullURL = FullURL & Iteration & i & "=" & AssignedGridView.DataKeys(i).Value.ToString()
Next
End Sub