D
dave
I am frustrated and not sure where to turn for help.
I have a custom control that has been working fine. The custom control is
composed of a dropdownlist and button. I have placed the control in a
repeater and it works just fine.
I have added a query filter at the top of the page where I create a new
datatable and rebind with the repeater. This is where the problem occcurs.
If I redirect to the page and execute the new query and rebind everything is
fine. If however, i postback the controls in the repeater do not seem to
have any properties and hence i get an error.
I would expect that this might be easy solution but i do not know what it
is.
I have implemented
Implements IPostBackDataHandler
Implements INamingContainer
One of the properties looks like the following (within the custom control)
Public Property DataTextField() As String
Get
If CType(ViewState("DataTextField"), Object) Is Nothing Then
Return _dataTextField
Else
Return CType(ViewState("DataTextField"), String)
End If
End Get
Set(ByVal value As String)
ViewState("DataTextField") = value
Me.DropDownList.DataTextField = value
_dataTextField = value
End Set
End Property
and also within the LoadPostData I do
Me.DataTextField = ViewState("DataTextField") and me.datatextfield has a
value after the postback.
The problem occurs when I try to rebind the same repeater with a new
datatable.
I do not understand how the postback would react differently than the page
load.
Any help would be very much appreciated.
thx
dave
I have a custom control that has been working fine. The custom control is
composed of a dropdownlist and button. I have placed the control in a
repeater and it works just fine.
I have added a query filter at the top of the page where I create a new
datatable and rebind with the repeater. This is where the problem occcurs.
If I redirect to the page and execute the new query and rebind everything is
fine. If however, i postback the controls in the repeater do not seem to
have any properties and hence i get an error.
I would expect that this might be easy solution but i do not know what it
is.
I have implemented
Implements IPostBackDataHandler
Implements INamingContainer
One of the properties looks like the following (within the custom control)
Public Property DataTextField() As String
Get
If CType(ViewState("DataTextField"), Object) Is Nothing Then
Return _dataTextField
Else
Return CType(ViewState("DataTextField"), String)
End If
End Get
Set(ByVal value As String)
ViewState("DataTextField") = value
Me.DropDownList.DataTextField = value
_dataTextField = value
End Set
End Property
and also within the LoadPostData I do
Me.DataTextField = ViewState("DataTextField") and me.datatextfield has a
value after the postback.
The problem occurs when I try to rebind the same repeater with a new
datatable.
I do not understand how the postback would react differently than the page
load.
Any help would be very much appreciated.
thx
dave