ASP.NET_實踐透過POST方式來開啟另一webform_如何將C#或VB.NET的List透過Json.NET處裡完傳給js
此時可能已經填塞了兩個List物件 lsColDataKeyCollection lsColDataValCollection 然後是透過Grid選取某列時做出傳送的 【發送端】父頁面 後端VB.NET Code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 Protected Sub Page_Load ( ByVal sender As Object, ByVal e As System . EventArgs ) Handles Me . Load Dim XC As New NameValueCollection ' ...... do something If Page.IsPostBack = False Then ' 頁面第一次載入只執行一次 ' ...... do something End If AddHandler GridShipContent.SelectedIndexChanging, AddressOf OnGridViewSelectedIndexChanging End Sub Private Sub OnGridViewSelectedIndexChanging(sender As Object, e As GridViewSelectEventArgs) If e.NewSelectedIndex < 0 Then Exit Sub ' ...... do something Me . Page . ClientScript . RegisterStartupScript ( Me . GetType (), "PostTest" , "DoPostOpen()" , True ) End Sub 前端Js部分 1 2 3 4 5 6 7 8 9 10 11 ...