Conditional Pop Up

Discussion in 'ASP .Net' started by danielle.m.manning@gmail.com, Apr 7, 2006.

  1. Guest

    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
    , Apr 7, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    8,497
    Randy Webb
    Feb 4, 2006
  2. Alec S.
    Replies:
    10
    Views:
    10,082
    Alec S.
    Apr 16, 2005
  3. Bone Ur
    Replies:
    4
    Views:
    368
    Bone Ur
    Dec 19, 2007
  4. Chris Davoli

    Tool Tip pop up - pop up time is too short

    Chris Davoli, Feb 24, 2009, in forum: ASP .Net
    Replies:
    1
    Views:
    451
    Lee Atkinson
    Feb 24, 2009
  5. Replies:
    2
    Views:
    71
Loading...

Share This Page