I have apage where the user selects two dates, and then a repeater is showing price information depending on the date interval(discounts etc) My problem is that the repeater isn't filled with new values when a postback occurs, here is my code:

VB Code:
  1. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  2.         If Not Page.IsPostBack Then
  3.                 FillUI()
  4.         Else
  5.                  RenderOrderLineRep()
  6.         End If
  7.  
  8.     End Sub
  9.  
  10.  
  11.  
  12. Public Sub RenderOrderLineRep()
  13.         Dim oOrder As New COrder
  14.         repOrderRows.DataSource = oOrder.GetOrderLineItemsByOrderId("1")
  15.         repOrderRows.DataBind()
  16.         oOrder = Nothing
  17.     End Sub

The FillUI() is a method that fills abunch of labels.. and calls the RenderOrderLineRep which is binding the control with the data


On the calendar control I ahve the following code when the user is selecting a date (tried first with a button to post the page, but for the information in the repeater to update I had to click TWICE)


VB Code:
  1. Private Sub calFromDate_SelectionChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles calFromDate.SelectionChanged
  2.         lblFromDate.Text = calFromDate.SelectedDate.ToShortDateString
  3.         calFromDate.Visible = False
  4.         imgFromDate.Visible = True
  5.         Dim oOrder As New COrder
  6.         oOrder.SetAllOrderLinePrices("1", DateDiff(DateInterval.Day, CDate(lblFromDate.Text), CDate(lblToDate.Text)))
  7.         'oOrder = Nothing
  8.     End Sub


As I understand it, when the user select a date, the new prices in updated into the database using oOrder.SetAllOrderLinePrices (I have checked in the database, and it works)
and then the page does a postback, and RenderOrderLineRep() is binding the new data to the repeater...

But why isn't this working? If I did the updating in a submit button instead of on date selection I had to press the button twice to see price changes in repeater, even that the db was updated on the first click.

Am I forgetting to close or flush or commit something??? This is getting on my nerves...

help, quickly please

kind regards
henrik