filter results of hyperlinked page

G

Guest

i have a 2 column datagrid (account_id, account). the second is a hyperlink
column with a URL Column account_id and a URL Format String
EnterTargets.aspx?id={0}. It looks like it's passing the variable (if that's
the right terminology) to the new page. The new page ends
/EnterTargets.aspx?id=14031. so, my problem is, how to use that variable on
the page?

the page loads a dropdown list with the months of the year in it (MonthID,
MonthDesc), and defaults to january. i have a datagrid on the page
/EnterTargets that's supposed to pull data from a sql table and show only
data for the month in the dropdown and related to account 14031 in this
case. i think the month code works but i'm to sure what to write to pass the
variable from the prior page. i'm stuck. any help would be great! thanks! My
code for the datagrid is:

Private Sub BindData(ByVal _ID As String)
Dim _SqlTargets As String = "Select account_id, category_id,
month_id, goal_dollars from goals_test where month_id = " & _ID
Dim _Ds As New DataSet
Dim _SqlConnection As New SqlConnection(strConn)
Dim _SqlCommand As New SqlCommand(_SqlTargets, _SqlConnection)
Dim _SqlDataAdapter As New SqlDataAdapter(_SqlCommand)
_SqlConnection.Open()
_SqlDataAdapter.Fill(_Ds)
DataGrid1.DataSource = _Ds
DataGrid1.DataBind()
End Sub
 
G

Guest

Ooops. Here's the click event that's supposed to display the datagrid. I was
actually hoping to have the datagrid display on the page load, but i don't
know how to do that yet...next week maybe...

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim strMonth_ID As String = ddlMonth.SelectedValue
BindData(strMonth_ID)
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top