views:

13

answers:

1

I am having trouble binding data to data repeater when I use ISyncResult. This is what I am doing. There is a button inside a Update Panel that gets the input from the user and calls a function that returns a dataset that I then bind to data repeater which is also inside a update panel. What I did is that I made a delegate to this function, now I am calling this function like this

Dim caller As New AsyncMyFunction(AddressOf MyFunction)

And then I make a IASyncResult like this :

 Dim result As IAsyncResult = caller.BeginInvoke(argument1, argument1, AddressOf MyFunctionCallBack, Nothing)

this is the Callback method:

 Sub MyFunctionCallBack(ByVal ar As IAsyncResult)
    Dim result As AsyncResult = CType(ar, AsyncResult)
    Dim caller As AsyncMyFunction = CType(result.AsyncDelegate, AsyncMyFunction)
    Dim ds As New DataSet
    ds = caller.EndInvoke(ar) 
    MyRep.DataSource = ds
    MyRep.DataBind()

End Sub

I am having hard time figuring out why the data repeater is showing no data. While debugging this I see that the dataset is getting the data and is passing the the "ds" but nothing is showing up on my page even though the data is being passed to controls inside data repeater while I am debugging.

A: 

its not work that way. BeginInvoke() is a way to call method async and it doesn't mean it gonna work with async postback. BeginInvoke() is async in local environment while async postback is just partial html update with remote environtment. it's 2 different things. u need to complete your dataset b4 u call databind

888
the function where the dataset is complete is somewhere else and in the callback function when I debug I see the data I also see while in debugger the values being passed to datarepeater. BUT, nothing is showing on browser after. I think there is a page update I am missing somewhere. Since the datarepeater is inside updatepanel I also tried Updatepanel.Update(), but NOTHING!
Besnik
can i see the asp page?
888