Advertisement

02.06.2008 at 01:31PM PST, ID: 23142765
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

UpdatePanel and Placeholder Control Problem

Tags: AJAX, UpdatePanel, Placeholder, C#, .NET 2.0, Dynamic Controls
Hello everyone,

I am having some problems with this page that has a Placeholder control inside an UpdatePanel control. When the updatepanel is triggered, then the page seems to do a full postback and I end up with 2 sets of controls added to the page instead of 1.

Here is where I'm creating the updatepanel and placeholder:
<asp:UpdatePanel ID="upd3" runat="server" UpdateMode="Conditional">
<ContentTemplate>
      <asp:PlaceHolder ID="plhSemesters" Runat="server" />
</ContentTemplate>
<Triggers>
      <asp:AsyncPostBackTrigger ControlID="btnSave1" EventName="Click" />
      <asp:AsyncPostBackTrigger ControlID="btnSave2" EventName="Click" />
</Triggers>
</asp:UpdatePanel>

Here is the code behind:
protected void Page_Load(object sender, EventArgs e)
{
      ...
      if (!IsPostBack)
      {
            //Enable Save Buttons
            btnSave1.Enabled = true;
            btnSave2.Enabled = true;
            //Set Course Title
            lblCourseTitle.Text = crs.courTitle;
      }
      //Display Semesters and each Location
      ArrayList sems = Semester.getSemesterList(DateTime.Now, sqlCon);
      DisplaySemesters(crs, sems, sqlCon);
      ...
}
private void DisplaySemesters(Course crs, ArrayList Semesters, SqlConnection sqlCon)
{
      //Go through each semester, and display all location frequencies
      plhSemesters.Controls.Clear();
      ...
      //TextBox for Course Frequency
      TextBox txtCFLoc = new TextBox();
      txtCFLoc.ID = "txt" + sem.semId + loc.locId;
      txtCFLoc.CssClass = "TextBox";
      txtCFLoc.MaxLength = 2;
      ...
      if (i % 2 == 0) { plhSemesters.Controls.Add(new LiteralControl("<tr class='ItemRow1'>")); }
      else { plhSemesters.Controls.Add(new LiteralControl("<tr class='ItemRow2'>")); }
      plhSemesters.Controls.Add(new LiteralControl("<td vAlign='middle' align='left' width='25%' class='LabelBold'>" + loc.locCity + "</td>"));
      plhSemesters.Controls.Add(new LiteralControl("<td vAlign='middle' align='left' width='10%'>"));
      plhSemesters.Controls.Add(txtCFLoc);
      plhSemesters.Controls.Add(new LiteralControl("</td>"));
      plhSemesters.Controls.Add(new LiteralControl("<td vAlign='middle' align='left' width='65%'></td>"));
      plhSemesters.Controls.Add(new LiteralControl("</tr>"));
      ...
}


When I click on one of the linkbuttons to trigger the updatepanel, I get a full page postback and 2 sets of controls.

Is there a bug with the updatepanel and placeholder controls or am I doing something wrong?
Start your free trial to view this solution
Question Stats
Zone: Programming
Question Asked By: quanmac
Solution Provided By: AngryBinary
Participating Experts: 2
Solution Grade: A
Views: 356
Translate:
Loading Advertisement...
02.06.2008 at 02:03PM PST, ID: 20836217

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.06.2008 at 02:14PM PST, ID: 20836305

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.06.2008 at 02:18PM PST, ID: 20836334

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.06.2008 at 02:20PM PST, ID: 20836343

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.06.2008 at 02:22PM PST, ID: 20836356

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.06.2008 at 02:26PM PST, ID: 20836381

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.06.2008 at 02:29PM PST, ID: 20836407

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.06.2008 at 02:54PM PST, ID: 20836610

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.06.2008 at 02:55PM PST, ID: 20836620

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.06.2008 at 11:29PM PST, ID: 20838877

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.06.2008 at 11:35PM PST, ID: 20838898

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080236-EE-VQP-29 / EE_QW_EXPERT_20070906