placeholder disappears on submit to Db

Posted on 2011-03-01
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
            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

Open in new window

Question by:kdeutsch
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
LVL 18

Expert Comment

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".

Author Comment

ID: 35007986
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.

Author Comment

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

    End Sub
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 18

Accepted Solution

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.

Author Comment

ID: 35008754
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.

Author Closing Comment

ID: 35008763

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
FTP recursive download files 5 26
AJAX Create / Update Not working MVC 5 62
GUID's in SQL Server 4 30
How do i create a simple array in a public class? 6 36
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

737 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