By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,985 Members | 1,712 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,985 IT Pros & Developers. It's quick & easy.

filter results of hyperlinked page

P: n/a
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
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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

"Mike C" wrote:
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

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.