Conditional Pop Up

  • Thread starter danielle.m.manning
  • Start date
D

danielle.m.manning

I have seen several tips for opening a popup window by adding an
OnClick event to a button in the code behind for ASP.NET. This is
ALMOST what I need.

However, I only want to invoke the popup if one of five fields on my
form have had their "textChanged". I have an event called Set Dirty
which is below, which runs on the controls which I am concerned with
and decides if they have been changed or not. If they have, I am
setting "needReason" to true, and then I want to invoke the popup. The
problem is that the onClick event for my update button has already
passed, so I can't say, "if needReason = true then
btnUpdate.Add("OnClick")...etc. Is there any way to simulate an
Onclick button? Or another way I can conditionally open this popup?

Here is my setDirty Method

Private Sub SetDirty(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles txtPassword.TextChanged, _
txtSCBalance.TextChanged, cboPlusMinus.SelectedIndexChanged,
chkTerminate.CheckedChanged, txtUserRating.TextChanged
If doneini = True Then
'If any of the fields which require a transaction have
changed then we are going to set needReason to true
If sender.GetType.Name = "ComboBox" Then
If sender.selectedindex() <> -1 And (Not
sender.selectedvalue() Is DBNull.Value) Then
Me.outstandingChanges = True
Me.needReason = True
End If
ElseIf sender.GetType.Name = "TextBox" Then
If sender.text.trim() <> "" Then
Me.outstandingChanges = True
Me.needReason = True
End If
ElseIf sender.GetType.Name = "CheckBox" Then
Me.outstandingChanges = True
Me.needReason = True
End If
End If
End Sub
 

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,756
Messages
2,569,535
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top