Popup Control Extender

Last post 05-03-2006 10:58 AM by lkeel. 12 replies.

Sort Posts:

  • Popup Control Extender

    04-13-2006, 1:01 PM
    • Member
      173 point Member
    • riceboyler
    • Member since 05-25-2005, 3:40 PM
    • Posts 37

    I'm using the popup control extender in a very similar manner to the example, that is, with a textbox popping a calendar, but I'm getting a JavaScript error after clicking a date on the calendar control that says:

    "Microsoft JScript runtime error: 'this.control.element' is null or not an object"

    I have the popup control extender and the textbox in an "external" UpdatePanel, and then the calendar is in it's own UpdatePanel.  Is this the reason for the problem?

  • Re: Popup Control Extender

    04-13-2006, 1:12 PM
    • Member
      90 point Member
    • jgc
    • Member since 01-17-2003, 2:01 PM
    • Posts 18

    Hi I'm getting an error dialog poup saying Assertion failed: duplicate use of id of "Textbox22_PopupControl"

    If I take the textbox out of the update panel all is ok

    (Browser is IE 7)

    this is my code:

    <

    atlas:UpdatePanel ID="UpdatePanel2" runat="server">

    <ContentTemplate><asp:TextBox ID="TextBox22" runat="server"></asp:TextBox>

    </ContentTemplate>

    </atlas:UpdatePanel>

    <

    asp:Panel ID="Panel1" runat="server" CssClass="popupControl">

    <atlas:UpdatePanel ID="UpdatePanel1" runat="server">

    <ContentTemplate>

    <cc1:PopupControlExtender ID="PopupControlExtender1" runat="server">

    <cc1:PopupControlProperties TargetControlID="TextBox22" PopupControlID="Panel1" Position="Bottom" />

    </cc1:PopupControlExtender>

    <center>

    <asp:Calendar ID="Calendar1" runat="server" BackColor="White" BorderColor="#999999"

    CellPadding="1" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt"

    ForeColor="Black" Width="160px" >

    <SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />

    <TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />

    <SelectorStyle BackColor="#CCCCCC" />

    <WeekendDayStyle BackColor="#FFFFCC" />

    <OtherMonthDayStyle ForeColor="#808080" />

    <NextPrevStyle VerticalAlign="Bottom" />

    <DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />

    <TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" />

    </asp:Calendar>

    </center>

    </ContentTemplate>

    </atlas:UpdatePanel>

    </

    asp:Panel>

     

    John Clark
  • Re: Popup Control Extender

    04-13-2006, 2:01 PM
    • Contributor
      4,346 point Contributor
    • sburke_msft
    • Member since 04-04-2006, 7:28 PM
    • Redmond, WA
    • Posts 770
    • AspNetTeam

    Yes - this is the same issue that caused problems with the ReorderList. Unfortunately it's a known issue with the "Atlas" April CTP. 

    Try setting <compilation debug="false"> in your web.config.  I think it may then work okay because the assert won't fire.  I know it doesn't really solve the problem, trust me I wish there was a better way to deal with this!

    Thanks,

    Shawn

    Don't forget, this posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Popup Control Extender

    04-13-2006, 2:58 PM
    • Member
      173 point Member
    • riceboyler
    • Member since 05-25-2005, 3:40 PM
    • Posts 37
    Thanks for the response and the great controls Shawn.  I'll give that a shot. 
  • Re: Popup Control Extender

    04-13-2006, 3:41 PM
    • Member
      173 point Member
    • riceboyler
    • Member since 05-25-2005, 3:40 PM
    • Posts 37

    Well, no go there either.  Turned off debugging and it still gives the error (only this time, in the browser itself).

    I wish Matt Hawley would get the Calendar Popup control from EWorldUI working in Atlas.  That would be GREAT!

  • Re: Popup Control Extender

    04-13-2006, 3:45 PM
    • Member
      90 point Member
    • jgc
    • Member since 01-17-2003, 2:01 PM
    • Posts 18

    Tried that doesn't give the assertion error but now its a javascript error!

    Looks like a wait of a month for the next release.

     

    John Clark
  • Re: Popup Control Extender

    04-13-2006, 7:03 PM
    • Star
      8,710 point Star
    • David Anson
    • Member since 04-11-2006, 1:39 AM
    • Microsoft
    • Posts 1,842

    All is not lost. :) Please take another look at the sample, if you don't mind. Notice that the TextBox that triggers the calendar popup isn't actually within an UpdatePanel. And because of the way PopupControlExtender1.Commit works, it doesn't need to be! PopupControlExtender1.Commit uses JavaScript to set the specified value into the specified control *on the client side*, so there is no need for an UpdatePanel to protect the affected control. I see the same problems you do with the sample code above, but it's seeming to me that the extra UpdatePanel isn't necessary in this case. I'll point to the sample page which seems to offer flicker-free behavior for the same scenario the sample above is attempting.

    Please let me know if there are details I'm missing here.

    Thanks!


    http://blogs.msdn.com/delay

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Popup Control Extender

    04-13-2006, 7:30 PM
    • Member
      90 point Member
    • jgc
    • Member since 01-17-2003, 2:01 PM
    • Posts 18

    The actual page not the one I posted above is a two column table with several rows of labels and controls, which is currently enclosed in an update panel. Splitting this up would be difficult I guess the easy way is to not have an update panel for now.

     

     

     

    John Clark
  • Re: Popup Control Extender

    04-14-2006, 3:26 PM
    • Star
      8,710 point Star
    • David Anson
    • Member since 04-11-2006, 1:39 AM
    • Microsoft
    • Posts 1,842
    FYI: I've brought this issue to the attention of the Atlas team with the hope that there's a bug on our/their end that can be fixed without too much difficulty. Thanks for your help!

    http://blogs.msdn.com/delay

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Popup Control Extender

    04-26-2006, 6:07 AM
    • Member
      34 point Member
    • Rammesses
    • Member since 04-20-2006, 1:46 PM
    • Posts 10

    I had a similar problem using this control and did a (hacky) code fix that seems to work OK. I've blogged about my experience here and posted the fix in the other thread (http://forums.asp.net/thread/1261835.aspx#1268626).

    Hope this helps

    Joel

  • Re: Popup Control Extender

    04-29-2006, 2:00 PM
    • Member
      30 point Member
    • vladhorby
    • Member since 04-17-2006, 1:28 PM
    • Monterrey, Mexico
    • Posts 6
    I tried your fix and yes, it works for target controls inside templates, but the error still appears when you have the target control inside an UpdatePanel.
    I hope the problem will be fixed in the next release of the toolkit, but, until then, it is possible to simulate the PopupControl using the CollapsiblePanel and a div with its style set to z-index: 1, position: absolute
     
    <cc22:collapsiblepanelextender id="collapsibleActionDateEI" runat="server">
      <cc22:CollapsiblePanelProperties CollapseControlID="tbActionDateEI" Collapsed="True"
        AutoCollapse="True" AutoExpand="True" CollapsedSize="0" ExpandControlID="tbActionDateEI"
        ExpandedSize="180" TargetControlID="calendarActionDateEI" />
    </cc22:collapsiblepanelextender>
    <asp:TextBox ID="tbActionDateEI" runat="server" Width="200px"></asp:TextBox>
    
    <div id="divCalendar" runat="server" style="display: block; z-index: 1; position: absolute; ">
    <asp:Calendar ID="calendarActionDateEI" runat="server" BackColor="White" BorderColor="#999999"
        CellPadding="4" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt" ForeColor="Black"
        Height="180px" OnSelectionChanged="calendarActionDateEI_SelectionChanged" Width="200px">
        <SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
        <TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
        <SelectorStyle BackColor="#CCCCCC" />
        <WeekendDayStyle BackColor="#FFFFCC" />
        <OtherMonthDayStyle ForeColor="#808080" />
        <NextPrevStyle VerticalAlign="Bottom" />
        <DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
        <TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" />
      </asp:Calendar>
      </div>
     It works fine when it is placed inside an update panel - i have it as an user control for reusability.
    Oh, you need to add  the event handler for the calendar:
    protected void calendarActionDateEI_SelectionChanged(object sender, EventArgs e)
    		{
    			tbActionDateEI.Text = calendarActionDateEI.SelectedDate.ToShortDateString();
    			
    		}
     I hope this helps.
    Vlad
    Vlad
  • Re: Popup Control Extender

    05-01-2006, 9:41 AM
    • Member
      57 point Member
    • lrr81765
    • Member since 04-28-2006, 7:34 PM
    • Posts 15

    Is the source for the example available ? I have tried to reproduce the textbox/popup calendar and have not been able to get it to work correctly.

    Larry

  • Re: Popup Control Extender

    05-03-2006, 10:58 AM
    • Member
      10 point Member
    • lkeel
    • Member since 05-03-2006, 10:34 AM
    • Posts 2
    I would also like to see some sample source of a calendar popup working in a formview template.

    -LK
Page 1 of 1 (13 items)