By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,442 Members | 1,327 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,442 IT Pros & Developers. It's quick & easy.

How to uncheck the checkbox??

P: 7
Hi..

Expand|Select|Wrap|Line Numbers
  1.  Protected Sub btnDelete_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDelete.Click
  2.         Dim chkBtndel As CheckBox
  3.         Dim strID As String = ""
  4.         Dim count As Integer = 0
  5.         Dim objdel As ProjectsProcessData = New ProjectsProcessData()
  6.         Dim arrOItems As ArrayList = New ArrayList()
  7.         Dim objdele As TR_Projects = New TR_Projects()
  8.         Try
  9.             For Each dataitem As DataListItem In DLProjects.Items
  10.                 If dataitem.ItemType = ListItemType.Item Or dataitem.ItemType = ListItemType.AlternatingItem Then
  11.                     ' -- Find all the item
  12.                     ' Dim objNewEmp As New FAMS.EntityClass.SVCEmployee
  13.  
  14.                     chkBtndel = dataitem.FindControl("chkRemovePart")
  15.  
  16.                     Dim lblProId As LinkButton = dataitem.FindControl("HyperID")
  17.  
  18.                     If chkBtndel.Checked = True Then
  19.                         strID += lblProId.ToolTip + ","
  20.                     End If
  21.                 End If
  22.  
  23.             Next
  24.  
  25.             strID = strID.Substring(0, strID.Length - 1)
  26.             count = objdele.DeleteProjectsRecords(strID)
  27.  
  28.             If count > 0 Then
  29.                 ShowMessage("Records Deleted Successfully")
  30.                 BindDataList()
  31.             Else
  32.                 ShowMessage("Unable To Request Process")
  33.  
  34.             End If
  35.  
  36.         Catch ex As Exception
  37.  
  38.         End Try
  39.     End Sub
In my datalist, when i try to delete a particular parent record ,it will display an alert message ("unable to request process").the checkbox is still checked after loading the page.Can you pls temme how to uncheck the checkbox??

Regards,
Shravs
May 10 '10 #1

✓ answered by ThatThatGuy

@shravanti88
if you want the checkbox to be unchecked... on page load....
you can manually write the code for this or you can change the CheckBox's ViewState property to False

Share this Question
Share on Google+
2 Replies


ThatThatGuy
Expert 100+
P: 449
@shravanti88
if you want the checkbox to be unchecked... on page load....
you can manually write the code for this or you can change the CheckBox's ViewState property to False
May 14 '10 #2

100+
P: 194
this may help you:

(How can I check the 'Checked' property of a dynamically-created checkbox during the Page_Load subroutine?)

http://stackoverflow.com/questions/1...-page-postback
May 14 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.