troubleshooting Question

Issue with modalpopupextender populating label

Avatar of mgmhicks
mgmhicks asked on
.NET ProgrammingVisual Basic.NETAJAX
7 Comments1 Solution331 ViewsLast Modified:
I have a modal popup extender, on a panel that has a label called lblMessage.  I have this group of code and when I change the lblmessage.text value it shows up correctly when I show the modalpopextender.  This section of code works fine when change the lblmessage.

Try
            If Not IsPostBack Then
                myString = "PW-521-20-11"
                'myString = Page.Request.QueryString("ID").ToString()
                myID = Split(myString, "-")
                hfPropID.Value = myID(0)
                hfBldgID.Value = myID(1)
                hfUnitID.Value = myID(2)
                hfResiID.Value = myID(3)

                If ValidateRequest Then
                Else
                    lblMessage.Text = "You have already taken the survey for this unit"
                    mePopUp.Show()
                End If
            Else
            End If
        Catch ex As Exception
            Dim myUtil As New MSUtils
            lblMessage.Text = "Your are not authorized to take this survey"
            mePopUp.Show()
        End Try

However I have another function and when I click the submit button and change the lblmessage.text value, it shows the original message in the label.  However if I click it again it then shows the correct label message.  Here is that code.

Protected Sub btnOk_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnOk.Click
        Dim mError As String = ""
        If ValidateForm(mError) Then
            btnPopUpOK.Attributes.Add("TAG", "NoError")
            If SaveData(mError) Then
            Else
                lblMessage.Text = mError
                btnPopUpOK.Attributes.Add("TAG", "NoError")
                mePopUp.Show()
            End If
        Else
            ' show pop with error
            lblMessage.Text = mError
            btnPopUpOK.Attributes.Add("TAG", "Error")
            mePopUp.Show()
        End If
    End Sub

My question is what is occurring that it takes 2 clicks for the message to change when I click the submit button, but it changes correctly in formload the first code I sent.

thanks in advance for the help
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 7 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros