vendredi 23 janvier 2015

Dropdown not Updating lbl in Updatepanel

Situation: Checkbox inside a updatepanel multiline textbox inside a different updatepanel. if the user checks the checkbox, the multiline text box gets a name... this works fine.


HTML:



<asp:UpdatePanel ID="upTraveling" runat="server"
UpdateMode="Conditional" ChildrenAsTriggers="False">
<ContentTemplate>
<asp:CheckBox ID="cbRUTraveler" runat="server" Text="I am a Traveler" AutoPostBack="True"
oncheckedchanged="cbRUTraveler_CheckedChanged1" />
</ContentTemplate>
</asp:UpdatePanel>
<td>
<asp:UpdatePanel ID="upTravelers" runat="server" ondatabinding="cbRUTraveler_CheckedChanged1"
UpdateMode="Conditional">
<ContentTemplate>
<asp:TextBox ID="tbTravelers"
Class="textwidth" runat="server" TextMode="MultiLine"
placeholder="FName LName, FName LName" required="required">
</asp:TextBox>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger
ControlID="cbRUTraveler" EventName="CheckedChanged" />
</Triggers>
</asp:UpdatePanel>



C#:

protected void cbRUTraveler_CheckedChanged1(object sender, EventArgs e)
{
tbTravelers.Text =
RequesterBPL.RequesterTraveling(cbRUTraveler.Checked, tbTravelers.Text);
going = cbRUTraveler.Checked;
}


I also have 2 other updatepanels on the same page... a dropdown list in one updatepanel and a label in another updatepanel. When a user selects a value in the dropdown list... it's suppose to trigger a name placement in the label.


HTML:



<td>
<asp:UpdatePanel ID="upManager" runat="server" ondatabinding="ddlTeam_SelectedIndexChanged" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddlTeam" EventName="SelectedIndexChanged" />
</Triggers>
<ContentTemplate>
<asp:Label ID="lblManager" runat="server" > </asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
</td>


C#:



protected void ddlTeam_SelectedIndexChanged(object sender, EventArgs e)
{
//upManager.Update();

lblManager.Text =
ManagerBPL.ReturnManagerName(ddlTeam.SelectedIndex);
}


However, when a user makes a selection in the dropdown, nothing happens. until the user checks the checkbox which has nothing to do with the label and the dropdown. Once the user checks (or unchecks) the checkbox... the label gets populated with the selection from the dropdown.


All controls are in a table for structure. I have the scriptmanager in place.


From what I've been reading on the net this maybe a bug... If not a bug does anyone see where I may be going wrong...?


Thanks





Aucun commentaire:

Enregistrer un commentaire