OnDeleteCommand Not Refreshing Page

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,439
Members
44,829
Latest member
PIXThurman

Latest Threads

Top