R
RN1
I have a Repeater control with 2 columns - the data under the 1st
column are links whereas those in the 2nd column are just text.
<script runat="server">
Sub Page_Load(.......)
'populating the Repeater & binding the data to it
End Sub
Sub Item_Command(ByVal obj As Object, ByVal ea As
RepeaterCommandEventArgs)
'If (Page.IsPostBack) Then
' rptrUsers.DataBind()
'End If
End Sub
Sub Item_DataBound(ByVal obj As Object, ByVal ea As
RepeaterItemEventArgs)
Response.Write("Data Bound<hr>")
If (Page.IsPostBack) Then
rptrUsers.DataBind()
End If
End Sub
Sub Item_Created(ByVal obj As Object, ByVal ea As
RepeaterItemEventArgs)
Response.Write("Item Created<br>")
End Sub
</script>
<form runat="server">
<asp:Repeater ID="rptrUsers" OnItemCommand="Item_Command"
OnItemCreated="Item_Created" OnItemDataBound="Item_DataBound"
runat="server">
....................
....................
....................
</asp:Repeater>
</form>
Assuming that the Repeater gets populated with 5 rows, when I run the
above code for the first time, OnItemCreated & OnItemDataBound fires 7
times - once for the header, 5 times for the 5 rows & once for the
footer.
Note the code in the sub named Item_Command which is commented. If I
uncomment the 3 lines & then click a link in the Repeater, the
Repeater no longer gets displayed.
Why so?
Thanks,
Ron
column are links whereas those in the 2nd column are just text.
<script runat="server">
Sub Page_Load(.......)
'populating the Repeater & binding the data to it
End Sub
Sub Item_Command(ByVal obj As Object, ByVal ea As
RepeaterCommandEventArgs)
'If (Page.IsPostBack) Then
' rptrUsers.DataBind()
'End If
End Sub
Sub Item_DataBound(ByVal obj As Object, ByVal ea As
RepeaterItemEventArgs)
Response.Write("Data Bound<hr>")
If (Page.IsPostBack) Then
rptrUsers.DataBind()
End If
End Sub
Sub Item_Created(ByVal obj As Object, ByVal ea As
RepeaterItemEventArgs)
Response.Write("Item Created<br>")
End Sub
</script>
<form runat="server">
<asp:Repeater ID="rptrUsers" OnItemCommand="Item_Command"
OnItemCreated="Item_Created" OnItemDataBound="Item_DataBound"
runat="server">
....................
....................
....................
</asp:Repeater>
</form>
Assuming that the Repeater gets populated with 5 rows, when I run the
above code for the first time, OnItemCreated & OnItemDataBound fires 7
times - once for the header, 5 times for the 5 rows & once for the
footer.
Note the code in the sub named Item_Command which is commented. If I
uncomment the 3 lines & then click a link in the Repeater, the
Repeater no longer gets displayed.
Why so?
Thanks,
Ron