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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

707 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