我在回调事件上绑定数据列表。单击数据列表中的按钮需要回发以获取另一个数据列表的数据。但回发后,页面上看不到数据列表。我不知道回发时发生了什么。请帮助我找到解决方案....
If IsPostBack = False Then
callback = ClientScript.GetCallbackEventReference(Me, "message", "processMyResult", "context")
Dim script As String = "function CallBack(message,context){" + callback + ";}"
ClientScript.RegisterClientScriptBlock(Me.GetType(), "CB", script:=script, addScriptTags:=True)
callbackhotelsearch = ClientScript.GetCallbackEventReference(Me, "message", "processhotelsearchResult", "context")
Dim scriptsearch As String = "function callbackhotelsearch(message,context){" + callback + ";}"
ClientScript.RegisterClientScriptBlock(Me.GetType(), "CB", script:=scriptsearch, addScriptTags:=True)
SearchTextBox.Attributes.Add("onkeyup", "javascrpt:LookUpStock()")
SearchTextBox.Attributes.Add("onfocus", "javascript:SetCursorToTextEnd()")
End If
Public Sub RaiseCallbackEvent(ByVal eventArgument As String) Implements System.Web.UI.ICallbackEventHandler.RaiseCallbackEvent
If (eventArgument) Is Nothing Then
returnValue = "-1"
Else
binddata(eventArgument)
End If
Dim sb As System.Text.StringBuilder = New System.Text.StringBuilder()
Dim sw As System.IO.StringWriter = New System.IO.StringWriter(sb)
Dim hw As HtmlTextWriter = New HtmlTextWriter(sw)
dataListPackages.RenderControl(hw)
returnValue = sb.ToString()
End Sub
Public Function GetCallbackResult() _
As String Implements _
System.Web.UI.ICallbackEventHandler.GetCallbackResult
Return returnValue
End Function
Public Function binddata(ByVal eventArgument As String) As Nullable
Dim adp As New dsRegistrationTableAdapters.searchPackagesTableAdapter()
Dim dt As New dsRegistration.searchPackagesDataTable()
dt = adp.GetData(eventArgument, StartDateTextBox.Text, EndDateTextBox.Text)
'StartDateTextBox.Text = "11-12-2012"
dataListPackages.DataSource = dt
dataListPackages.DataBind()
SearchTextBox.Focus()
Return Nothing
End Function
谢谢你