Modal Window

3 posts, 0 answers
  1. Mossie
    Mossie avatar
    6 posts
    Member since:
    Jun 2012

    Posted 25 Jul 2012 Link to this post

    I have an application where a RadWindow opens a modal window - the size of the child window being larger then the parent and im following the example in the DialogReturnValue example.  A button in the parent window opens the child window.

    It all works fine if the buton is a html button 
    <button onclick="openWin2();" style="width: 123px" title="Window2">Test2</button>

    However the chld window is NOT modal if the button is an asp button
    <asp:Button ID="Button1" runat="server" Text="Button" />

    The page load defining the attribute of the button
    Button1.Attributes.Add("onclick", "javascript:openWin2();return false;")

    Any ideas ?

    Allen

  2. rdmptn
    rdmptn avatar
    72 posts
    Member since:
    Aug 2011

    Posted 26 Jul 2012 Link to this post

    Allen, have you taken a look at this article: http://www.telerik.com/help/aspnet-ajax/window-programming-opening-from-within-dialog.html? Do you use the timeout that is shown there?
  3. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 27 Jul 2012 Link to this post

    Hi Mossie,

    Unfortunatelly I couldn't replicate the issue that you are facing. Following is the code that I tried and worked as expected at my end.

    ASPX:
    // Parent Page
     
    <telerik:RadWindowManager ID="RadWindowManager1" ShowContentDuringLoad="false" VisibleStatusbar="false" ReloadOnShow="true" runat="server" Skin="Sunset" EnableShadow="true">
      <Windows>
         <telerik:RadWindow ID="RadWindow1" runat="server" Behaviors="Close" OnClientClose="OnClientClose" NavigateUrl="Default1.aspx">
         </telerik:RadWindow>
         <telerik:RadWindow ID="RadWindow2" runat="server" Width="650" Height="480" Modal="true" NavigateUrl="Default2.aspx">
         </telerik:RadWindow>
      </Windows>
    </telerik:RadWindowManager>
     
    // Child Page
     
    <fieldset id="fld1">
      <legend>One way ticket</legend><span style="margin: 6px 0 0 18px;">Choose date:</span>
      <telerik:RadDatePicker ID="Datepicker1" Skin="Sunset" runat="server" Width="140">
        <ClientEvents OnPopupOpening="AdjustRadWidow" OnPopupClosing="AdjustRadWidow" />
      </telerik:RadDatePicker>
      <div style="margin: 20px 0 0 0;">
         <div style="float: left; margin: 6px 0 0 18px;">Choose City:</div>
         <input type="text" style="width: 100px;" id="cityName" value="Sofia" />
         <asp:Button ID="Button1" runat="server" Text="Button" />
      </div>
    </fieldset>

    C#:
    protected void Page_Load(object sender, EventArgs e)
        {
            Button1.Attributes.Add("onclick", "javascript:openWin2();return false;");
        }

    Javacript:
    <script type="text/javascript">
     function openWin2()
     {
      var parentPage = GetRadWindow().BrowserWindow;
      var parentRadWindowManager = parentPage.GetRadWindowManager();
      var oWnd2 = parentRadWindowManager.open("Default2.aspx", "RadWindow2");
      window.setTimeout(function () {
      oWnd2.setActive(true);
      }, 0);
     }
    </script>

    Please provide your full code if it doesn't helps.

    Thanks,
    Shinu.
Back to Top