This is a migrated thread and some comments may be shown as answers.

Modal Window

2 Answers 44 Views
Window
This is a migrated thread and some comments may be shown as answers.
Mossie
Top achievements
Rank 1
Mossie asked on 25 Jul 2012, 09:03 AM
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 Answers, 1 is accepted

Sort by
0
rdmptn
Top achievements
Rank 1
answered on 26 Jul 2012, 01:15 PM
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?
0
Shinu
Top achievements
Rank 1
answered on 27 Jul 2012, 09:55 AM
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.
Tags
Window
Asked by
Mossie
Top achievements
Rank 1
Answers by
rdmptn
Top achievements
Rank 1
Shinu
Top achievements
Rank 1
Share this question
or