PDA

View Full Version : Variables in the URL Query string using Navigate()



reynoben
05 Oct 2009, 02:50 PM
I am not a web developer by any means. I've been given the duties of maintaining an internal website for work and am stumbling through some issues. Here is what I want to accomplish.

Using VB Script (.asp) I have an interactive button and an 2 option buttons. The option buttons dictate if my sort will be in ascending or descending order. For the OnClick I call a subroutine. Within the sub I have the following Code:

Sub Analyst_onclick()

Dim var_Year = year(date)

If Document.frmProfile.optAscDesc(0).checked Then
Navigate("ProfileViewReportMgr.asp?vCurrentYear=2009&vSortBy=Name&vAscDesc=Asc")

Else
Navigate("ProfileViewReportMgr.asp?vCurrentYear=2009&vSortBy=Name&vAscDesc=Desc")
End If
End Sub

Right now I have the year hard coded in the vCurrentYear field and it works. What I need to do is get the var_Year in the query string. Everytime I try to concatenate I get an error.

Am I using the right function (Navigate)? Can you use variables to populate values in the query string?

Thanks!