Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


placeholder disappears on submit to Db

Posted on 2011-03-01
Medium Priority
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

LVL 18

Accepted Solution

ChetOS82 earned 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

636 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