T
Terry Cox, MCSD
I have this problem throughout a site I am designing. The Update, Edit, and Insert commands all seem to re-databind properly, but the the OnDeleteCommand only processes. The deleted item remains on the screen unless I refresh the page. I have done this a thousand times and can't figure out what the deal is. Below is the code:
<<HEAD CODE>>
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" Debug="True"%>
<script runat="server">
Sub Page_Load(Src As Object, E As EventArgs)
If Not isPostBack then
BindList()
end if
end sub
Public Sub BindList()
dim s as new RCMS.Feedback
with myDataList
.datasource = s.GetFeedback(session("venueid"))
.databind()
end with
End Sub
Sub Remove(Sender as Object, e as DataListCommandEventArgs)
dim s as New RCMS.Feedback
dim i as integer
i = ctype(e.Item.FindControl("lblID"), Label).Text
s.Remove(i)
BindList() ' <-
End Sub
</script>
<<END HEAD CODE>>
<< BODY CODE >>
<asp:datalist id="MyDataList" runat="server" width="100%" OnDeleteCommand="Remove" >
blah blah blah
<asp:Label ID="lblId" runat="server" visible="False" text=<%# Databinder.Eval(Container.DataItem, "pkid")%> />
<asp:LinkButton CommandName="Delete" ID="btnDel" runat="server" Text="Delete"></asp:LinkButton>
</asp:datalist>
<< END BODY CODE >>
Any help would be greatly appreciated!
Best Regards,
Terry A. Cox
<<HEAD CODE>>
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" Debug="True"%>
<script runat="server">
Sub Page_Load(Src As Object, E As EventArgs)
If Not isPostBack then
BindList()
end if
end sub
Public Sub BindList()
dim s as new RCMS.Feedback
with myDataList
.datasource = s.GetFeedback(session("venueid"))
.databind()
end with
End Sub
Sub Remove(Sender as Object, e as DataListCommandEventArgs)
dim s as New RCMS.Feedback
dim i as integer
i = ctype(e.Item.FindControl("lblID"), Label).Text
s.Remove(i)
BindList() ' <-
End Sub
</script>
<<END HEAD CODE>>
<< BODY CODE >>
<asp:datalist id="MyDataList" runat="server" width="100%" OnDeleteCommand="Remove" >
blah blah blah
<asp:Label ID="lblId" runat="server" visible="False" text=<%# Databinder.Eval(Container.DataItem, "pkid")%> />
<asp:LinkButton CommandName="Delete" ID="btnDel" runat="server" Text="Delete"></asp:LinkButton>
</asp:datalist>
<< END BODY CODE >>
Any help would be greatly appreciated!
Best Regards,
Terry A. Cox