Using RadWindow to Replace the Modal Popup Extender

7 posts, 0 answers
  1. Robert
    Robert avatar
    253 posts
    Member since:
    Aug 2007

    Posted 11 Jan 2011 Link to this post

    Way back when I used the AJAX Control Toolkit's "Modal Popup Extender" control to create some interactive dialog boxes in my ASP.net application.  I'm attaching a screenshot sample of one of them.

    Now that I've purchased your full set of controls, I'm investigating whether I can use RadWindow to replace the Modal Popup Extender.

    I thought I was getting somewhere but then hit some roadblocks.  The crux of the problem is that with RadWindow, it seems impossible to do both of the following from the click of an ASP.net button:
    1. Run server-side code to initialize the contents of the dialog box.
    2. Open the dialog box.
    My testing results seem to be confirmed by this: http://mono.telerik.com/Window/Examples/OpenAndPosition/DefaultCS.aspx

    However, I thought that I should check with you to see if anything has changed in this regard or is about to, for it sure would be great if this functionality were possible!

    Sincerely,

    Robert W.
    Vancouver
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 12 Jan 2011 Link to this post

    Hello Vancouver,

    The RadWindow can be used to hold internal content which is part of the same page in which it is declared. When used in this manner it acts as a standard container element and the content can be accessed from code behind.

    See the sample code:
    aspx:
    <telerik:RadWindow ID="Win1" VisibleOnPageLoad="true" runat="server" VisibleStatusbar="false"
        Animation="Fade" ShowContentDuringLoad="true" VisibleTitlebar="false" Behaviors="Resize"
        Modal="false">
        <ContentTemplate>
            <asp:Button ID="Button4" runat="server" Text="Button" />
        </ContentTemplate>
    </telerik:RadWindow>


    code:
    protected void Page_Load(object sender, EventArgs e)
    {
        (Win1.ContentContainer.FindControl("Button4") as Button).Enabled = false;
    }

    More information about this can be found here: Use as controls container

    For showing RadWindow from code, set the VisibleOnPageLoad property to "True".
    RadWindow implementation


    Thanks,
    Princy.
  3. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 12 Jan 2011 Link to this post

    Hello Robert,

    Actually, you can do that :)
    In the latest versions of the control, RadWindow can be used as controls container. More information on the subject is also available in this help topic.


    Best wishes,
    Georgi Tunev
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  4. Robert
    Robert avatar
    253 posts
    Member since:
    Aug 2007

    Posted 12 Jan 2011 Link to this post

    Thanks for the advice, folks.  Following your advice, I was able to successfully keep the RadWindow displayed.  However, being inside an AJAX enabled page, it kept flashing off & on during each partial postback.  With the Modal Popup Extender this flashing doesn't occur.  So until there's an improved version of RadWindow, I'm going to stick with what I have.

    Robert
  5. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 17 Jan 2011 Link to this post

    Hello Robert,

    I am not quite sure what the problem is, as I don't know your exact setup and logic, but if you send me a sample project that reproduces the problem, in a support ticket, I will check it right away.

    Kind regards,
    Georgi Tunev
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  6. Robert
    Robert avatar
    253 posts
    Member since:
    Aug 2007

    Posted 22 Jan 2012 Link to this post

    Georgi,

    My apologies for not moving forward with the RadWindow issue in 2011 but I am once again pursuing the issue here: http://www.telerik.com/community/forums/aspnet-ajax/window/is-a-partial-postback-with-radwindow-possible.aspx

    In a nutshell, I believe my quandary can be answered with one question about this example of yours: http://demos.telerik.com/aspnet-ajax/window/examples/internalcontent/defaultcs.aspx

    In that example, could server-side event handlers be added, such as when one leaves one of the four textboxes in Edit mode?  In answering that question it would be critical for the RadWindow NOT to flash off and then back on again.  Simply put, server-side code would be run, assorted control contents updated if necessary, and then focus return back to the UI.  I cannot seem to accomplish this without the annoying flash off & on of the RadWindow and its contents.

    Most interested in your thoughts,

    Robert Werner
  7. Marin Bratanov
    Admin
    Marin Bratanov avatar
    5243 posts

    Posted 23 Jan 2012 Link to this post

    Hello Robert,

    I have answered you other thread on the same matter (http://www.telerik.com/community/forums/aspnet-ajax/window/is-a-partial-postback-with-radwindow-possible.aspx) and I suggest we keep the conversation in only one place. Please see the sample I attached there and let me know how it goes with you.

    As for the question related to the online demo - the approach from my sample is valid there as well. It is actually implemented, but by using the RadAjaxManager's settings instead of regular asp UpdatePanels. Please examine the code fully (you can run it locally by starting the sample site from the LiveDemos folder in your installation). There are event handlers in the code-behind and there is no flicker.


    All the best,
    Marin
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top