我有一箇中繼器控件和ItemDataBound事件我想獲取中繼器控件中的值並通過傳遞這些值作爲參數重定向到另一個頁面。 我寫了下面的代碼我如何從中繼器的ItemDataBound事件通過傳遞值重定向到另一個頁面
Protected Sub rptData_ItemDataBound(ByVal source As Object, ByVal e As RepeaterItemEventArgs)
Dim content As String = ""
Dim url As String = ""
Dim lbl1 As Label = TryCast(e.Item.FindControl("content"), Label)
Dim lbl2 As Label = TryCast(e.Item.FindControl("url"), Label)
content = lbl1.Text
url = lbl2.Text
Dim btn As LinkButton = CType(e.Item.FindControl("glossary"), LinkButton)
btn.Attributes.Add("onclick", "Response.Redirect('glossary.aspx?cont=' + content + 'url=' + url)return true;")
end su
確實接受答案,如果它適合你 – 2011-03-21 05:22:52
@pranay ...絕對 – 2011-03-21 05:31:08