Multiple PopupControlProperties?

Last post 08-17-2006 8:09 PM by David Anson. 17 replies.

Sort Posts:

  • Re: Multiple PopupControlProperties?

    07-14-2006, 7:30 PM
    • Star
      8,710 point Star
    • David Anson
    • Member since 04-11-2006, 1:39 AM
    • Microsoft
    • Posts 1,842
    I've created work item 953 for this issue. I'd say make that method public yourself for now - and please let us know if that does/doesn't work for you!

    http://blogs.msdn.com/delay

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Multiple PopupControlProperties?

    07-17-2006, 1:35 PM
    • Member
      65 point Member
    • jgiganti
    • Member since 06-30-2006, 7:31 PM
    • Posts 13

    I went ahead and made the method public and that resolves the problem I was having.

    Here is what I am doing.

    I have a calendar control that is used by 2 different text boxes and is displayed by the popup control. During the Calendar SelectionChanged event I save the SelectedDate of the calendar control and call the control extenders Commit method with the saved date. I then use GetCurrentExtenderInfo to get the targetBehaviorID and use FindControl to locate the proper textbox. Once I have that I set the Text property on the textbox.

    Now when the update panel that contains the GridView uses DataBind the proper information is populated in the Grid. Had I not manually set the Text property on the text box then invalid data was being used and the DataBind would return invalid results.

    • The GridView is in a different update panel than the PopupControlExtender.
    • The DateSource used by the GridView is querying via a stored proc with the data coming from 3 text box controls. 2 of which are used by the popup control extender.
    • The GridViews update panel has ControlValue Triggers on all 3 text boxes.

    I am thinking that this situation would be fairly common and am wondering if perhaps I went about it incorrectly.

    What I have seen is that when DataBind is called the values that the control extender sets are not updated soon enough.

    Is there a better way to do this.

     

    I am planning on adding a GetCurrentControl method, like GetCurrent to the toolkit to return the control that caused the popup to occur. It would function like GetCurrent only it would find the control that matches the behaviorID , minues the leading _.

  • Re: Multiple PopupControlProperties?

    08-17-2006, 8:09 PM
    • Star
      8,710 point Star
    • David Anson
    • Member since 04-11-2006, 1:39 AM
    • Microsoft
    • Posts 1,842

    I was about to work on work item 953, but when I wrote the demo page to reproduce the problem, I suddenly didn't understand the need for this change. Please consider the below sample page which has a single PopupControl hooked up to two TextBoxes. It doesn't seem to have any trouble populating the correct TextBox with the 60731 release of the Toolkit. Please let me know what steps/scenarios I might be overlooking just now. (And if you can modify the sample to demonstrate the problem, that'd be even better!) Thanks!

     
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="AtlasControlToolkit" Namespace="AtlasControlToolkit" TagPrefix="atlasToolkit" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <script runat="server">
        protected void Button1_Click(object sender, EventArgs e)
        {
            PopupControlExtender.GetCurrent(Page).Commit(DateTime.Now.ToLongTimeString());
        }
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
            <div>
                <atlas:ScriptManager ID="ScriptManager1" EnablePartialRendering="true" runat="server" />
                <asp:TextBox ID="TextBox1" runat="server" />
                <asp:TextBox ID="TextBox2" runat="server" />
                <asp:Panel ID="Panel1" runat="server" Height="50px" Width="125px">
                    <atlas:UpdatePanel ID="UpdatePanel1" runat="server">
                        <ContentTemplate>
                            <asp:Button ID="Button1" runat="server" Text="Button" UseSubmitBehavior="false" OnClick="Button1_Click" />
                        </ContentTemplate>
                    </atlas:UpdatePanel>
                </asp:Panel>
                <atlasToolkit:PopupControlExtender ID="PopupControlExtender1" runat="server">
                    <atlasToolkit:PopupControlProperties TargetControlID="TextBox1" PopupControlID="Panel1" Position="Bottom" />
                    <atlasToolkit:PopupControlProperties TargetControlID="TextBox2" PopupControlID="Panel1" Position="Bottom" />
                </atlasToolkit:PopupControlExtender>
            </div>
        </form>
    </body>
    </html>
    
     

    http://blogs.msdn.com/delay

    This posting is provided "AS IS" with no warranties, and confers no rights.
Page 2 of 2 (18 items) < Previous 1 2