calling a subroutine in datalist edit mode

B

buran

Dear ASP.NET Programmers,

Please consider the following code:

Private Sub dliStayDetails_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataListItemEventArgs) Handles
dliStayDetails.ItemDataBound

If e.Item.ItemType = ListItemType.EditItem Then
Dim deleteButton As LinkButton
deleteButton = CType(e.Item.FindControl("lnkDelDischarge"),
LinkButton)
End If

End Sub

I would like to call function whick deletes the contents of a textbox in
datalist edit mode. I wrote the following procedure but I don't have an idea
how to call it.

Sub ClearDischargeDate(ByVal sender As Object, ByVal e As
DataListItemEventArgs)
Dim txtDis As TextBox
txtDis = CType(e.Item.FindControl("txtDisDate"), TextBox)
txtDis.Text = ""
End Sub

Any suggestions? Thanks in advance,
Buran
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top