Tags: ajax, aspnet, bound, box, calendar, control, drop, inside, lists, modalpopupextender, moves, nested, net, popupcontrolextender, select, text, tied

Calendar inside popupcontrolextender nested in modalpopupextender moves

On .Net » ASP.NET AJAX

3,139 words with 1 Comments; publish: Sun, 06 Jan 2008 00:37:00 GMT; (10062.50, « »)

I have a calendar control bound to a popupcontrolextender tied to a text box. The calendar has two drop down lists above it. One to select month and one to select year. When I change the month or year, the calendar posts back via ajax and displays the correct calendar but moves it to the upper left of my panel. I have the position attribute of the popupcontrolextender set to bottom, I even attemp to reset it to that value in the code behind events for the year and month dropdownlists. Anyone else run into this?

All Comments

Leave a comment...

  • 1 Comments
    • If you want to change the postion?of?the?popup?calendar?panel,try?to?set?the?properties?of??the - Position,OffsetX,OffsetY

      Here are some sample codes for your reference.

      <div>

      <asp:UpdatePanel ID="upnlCalendar" runat="server">

      <ContentTemplate>

      <asp:Panel ID="pnlCalendar" runat="server">

      <table>

      <tr>

      <td><asp:Label ID="lblYear" runat="server" Text="Year:"></asp:Label></td>

      <td>

      <asp:DropDownList ID="ddlYear" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlYear_SelectedIndexChanged">

      <asp:ListItem Text="1900" Value="0"></asp:ListItem>

      <asp:ListItem Text="1990" Value="1"></asp:ListItem>

      <asp:ListItem Text="19980" Value="2"></asp:ListItem>

      <asp:ListItem Text="2000" Value="3"></asp:ListItem>

      <asp:ListItem Text="2007" Value="4"></asp:ListItem>

      </asp:DropDownList>

      </td>

      </tr>

      <tr>

      <td><asp:Label ID="lblMonth" runat="server" Text="Month:"></asp:Label></td>

      <td>

      <asp:DropDownList ID="ddlMonth" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlMonth_SelectedIndexChanged">

      <asp:ListItem Text="January" Value="0"></asp:ListItem>

      <asp:ListItem Text="Feburary" Value="1"></asp:ListItem>

      <asp:ListItem Text="March" Value="2"></asp:ListItem>

      <asp:ListItem Text="April" Value="3"></asp:ListItem>

      <asp:ListItem Text="May" Value="4"></asp:ListItem>

      </asp:DropDownList>

      </td>

      </tr>

      <tr>

      <asp:Calendar ID="Calendar1" runat="server"></asp:Calendar>

      </tr>

      </table>

      </asp:Panel>

      Date:<asp:TextBox ID="tbDate" runat="server"></asp:TextBox>

      <Ajax:PopupControlExtender ID="PopupControlExtender1" runat="server" Position="Bottom" PopupControlID="pnlCalendar" TargetControlID="tbDate" OffsetX="-10" OffsetY="0">

      </Ajax:PopupControlExtender>

      </ContentTemplate>

      <Triggers>

      <asp:AsyncPostBackTrigger ControlID="ddlYear" EventName="SelectedIndexChanged" />

      <asp:AsyncPostBackTrigger ControlID="ddlMonth" EventName="SelectedIndexChanged" />

      <asp:PostBackTrigger ControlID="Calendar1" />

      </Triggers>

      </asp:UpdatePanel>

      </div

      Wish the above can help you.

      #1; Sun, 06 Jan 2008 00:39:00 GMT