Solved

placeholder disappears on submit to Db

Posted on 2011-03-01
6
396 Views
Last Modified: 2012-06-27
I have a placeholder that is filled with labels that should remain static unless they move to another person, but when i commit a transaction to a db, ithe information in the placeholder disappears and then I have to go back and load it agian.  I put my sections inot 2 different updatepanels but it still happens, how can i keep the information in placeholder on the screen.


This get run when they pick a person. and put in a placeholder, I have it in a seperate updatepanel but when ever I commit a transaction it disappears.

 If myDataTable.Rows.Count = 0 Then
            Dim lblMessage As New Label()
            lblMessage.Text = "No Family Member"
            lblMessage.ForeColor = Drawing.Color.Firebrick
            phFamily.Controls.Add(lblMessage)
        Else
            For Each row As DataRow In myDataTable.Rows
                Dim lblMessage As New Label()
                'Create the message control
                lblMessage.Text = "  " & row(0).ToString & "<br />"
                lblMessage.ForeColor = Drawing.Color.Firebrick
                phFamily.Controls.Add(lblMessage)
            Next

Open in new window

0
Comment
Question by:kdeutsch
  • 4
  • 2
6 Comments
 
LVL 18

Expert Comment

by:ChetOS82
ID: 35007690
Placeholders don't "remember" the information that was put in them, they need to be rebound on every postback.

Now, if you placeholder is in one UpdatePanel, and your trying to update a different UpdatePanel, then you need to set the "UpdateMode" on both UpdatePanels to "Conditional".
0
 

Author Comment

by:kdeutsch
ID: 35007986
ChetOS82:
Thanks, I played with it and only set the one to conditional, if I sent them both then it does not work.  The inforimation in the second update panel is reliant on the first panel of information and without it cannot appear, and setting it to conditional kept it from appearing.
0
 

Author Comment

by:kdeutsch
ID: 35008082
Ok, this shut down other things on my page, I have 2 link buttons on a modal popup one that keeps me on the page and the other that hides and refreshes the page.  This is the point that is nto working.  It now does nothing.  Is there something I have to do.  This protion sits in the other update panel.

 Protected Sub lnkProbCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkProbCancel.Click
        Dim SrpID As Integer = ddlSrpEvent.SelectedValue
        txtFindSoldier.Text = String.Empty
        ddlSrpEvent.SelectedValue = SrpID
        pnlSRP.Visible = False

        pnlProblems_ModalPopupExtender.Hide()
    End Sub
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 18

Accepted Solution

by:
ChetOS82 earned 500 total points
ID: 35008096
If you have inter-UpdatePanel changes, then you cannot use Conditional mode.

The placeholder needs to be repopulated (rebound) every time it is loaded because it doesn't not store the state of all the controls across postbacks.
0
 

Author Comment

by:kdeutsch
ID: 35008754
ChetOS82:
Ok, see what you mean, what a pain.  Problem is the page is reliant on both.  Thanks for the help, i will rebind  the placeholder at this point.
0
 

Author Closing Comment

by:kdeutsch
ID: 35008763
thanks
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question