I must be overlooking something and I've been searching the forums trying everything I can find.
I have a master page which has RadScriptManager1. This is by design and I have a RadComboBox in the master page as well.
In my content page I have a RadGrid (which should be irrelevant to this issue), a RadWindowManager1 which contains a single RadWindow, and a standard Button1.
When you click Button1, the OpenerElementID of my RadWindow should make the RadWindow open modal.
If I put the exact same code on a page that does not have master pages and obviously add a scriptmanager, it works perfect. As soon as I do this when the content page inherits a master page, when I click the button, a postback occurs and no RadWindow appears.
Version: RadControls_Prometheus_2007_3_1425
I would greatly appreciate any thoughts or things to try.
I have a master page which has RadScriptManager1. This is by design and I have a RadComboBox in the master page as well.
In my content page I have a RadGrid (which should be irrelevant to this issue), a RadWindowManager1 which contains a single RadWindow, and a standard Button1.
When you click Button1, the OpenerElementID of my RadWindow should make the RadWindow open modal.
If I put the exact same code on a page that does not have master pages and obviously add a scriptmanager, it works perfect. As soon as I do this when the content page inherits a master page, when I click the button, a postback occurs and no RadWindow appears.
Version: RadControls_Prometheus_2007_3_1425
I would greatly appreciate any thoughts or things to try.
4 Answers, 1 is accepted
0
Zachary
Top achievements
Rank 1
answered on 27 Feb 2008, 05:42 PM
Here is the code on the content page:
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateEditColumn="True"
GridLines="None">
<ExportSettings>
<Pdf PaperSize="Letter" FontType="Subset"></Pdf>
<Excel Format="Html"></Excel>
<Csv RowDelimiter="NewLine" ColumnDelimiter="Comma"></Csv>
</ExportSettings>
<MasterTableView CurrentResetPageIndexAction="SetPageIndexToFirst" Dir="LTR" Frame="Border" TableLayout="Auto" CommandItemDisplay="None">
<RowIndicatorColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType" Visible="False">
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType" Visible="False" Resizable="False">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
<EditFormSettings>
<EditColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"></EditColumn>
</EditFormSettings>
</MasterTableView>
</telerik:RadGrid>
<br />
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
<Windows>
<telerik:RadWindow runat="server" Animation="None" Behavior="Default"
Behaviors="Default" InitialBehavior="None" InitialBehaviors="None" Left=""
Modal="True" NavigateUrl="ContractAddContractBlock.aspx?ContractID=5"
OpenerElementID="Button1" Skin="Mac" style="display:none;" Top=""
ID="AddBlock" VisibleStatusbar="False">
</telerik:RadWindow>
</Windows>
</telerik:RadWindowManager>
<br />
<br />
<asp:Button ID="Button1" runat="server" Text="Button" />
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateEditColumn="True"
GridLines="None">
<ExportSettings>
<Pdf PaperSize="Letter" FontType="Subset"></Pdf>
<Excel Format="Html"></Excel>
<Csv RowDelimiter="NewLine" ColumnDelimiter="Comma"></Csv>
</ExportSettings>
<MasterTableView CurrentResetPageIndexAction="SetPageIndexToFirst" Dir="LTR" Frame="Border" TableLayout="Auto" CommandItemDisplay="None">
<RowIndicatorColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType" Visible="False">
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType" Visible="False" Resizable="False">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
<EditFormSettings>
<EditColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"></EditColumn>
</EditFormSettings>
</MasterTableView>
</telerik:RadGrid>
<br />
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
<Windows>
<telerik:RadWindow runat="server" Animation="None" Behavior="Default"
Behaviors="Default" InitialBehavior="None" InitialBehaviors="None" Left=""
Modal="True" NavigateUrl="ContractAddContractBlock.aspx?ContractID=5"
OpenerElementID="Button1" Skin="Mac" style="display:none;" Top=""
ID="AddBlock" VisibleStatusbar="False">
</telerik:RadWindow>
</Windows>
</telerik:RadWindowManager>
<br />
<br />
<asp:Button ID="Button1" runat="server" Text="Button" />
0
Zachary
Top achievements
Rank 1
answered on 28 Feb 2008, 02:43 PM
I made a mistake in the title. It isn't that ajax doesn't work, its that the RadWindow doesn't.
At this point, I am trying Telerik's own code, modifying it on to change the word rad to telerik since it appears from prior verion.
http://www.telerik.com/demos/aspnet/Window/Examples/ASPNET2/MasterPages/DefaultCS.aspx
At this point, I am trying Telerik's own code, modifying it on to change the word rad to telerik since it appears from prior verion.
http://www.telerik.com/demos/aspnet/Window/Examples/ASPNET2/MasterPages/DefaultCS.aspx
<telerik:RadWindowManager
id="Singleton"
VisibleOnPageLoad = true
OffsetElementId = "OffsetElement"
runat=server>
<windows>
<telerik:RadWindow ID="RadWindow1"
Runat="server"
Height="230px"
NavigateUrl="../../../TestPage/Default.html" OpenerElementID="Button1"></telerik:RadWindow>
</windows>
</telerik:RadWindowManager>
<asp:Button ID="Button1" runat="server" Text="Button" />
If I just drop this code on a page, it will launch and tell me that a ScriptManager is required before the code. So I drop a RadScriptManager and launch it. Everything works great.
If I bring in my master page (which has a RadScriptManager on it) and drop this exact same working code, when I click the button, a full page postback occurs, the entire page obviously refreshes, and no RadWindow appears.
Is it because in my master page, the <FORM> tag starts above this ContentPlaceHolder and ends after it? Or is there something else I should be looking into? Should I just write a javascript function of some sort?
Thanks.
0
Accepted
Hi Zachary,
The OpenerElementID property of RadWindow is provided for ease of developers who wish to associate a window with an opener without writing any code. However, since an opener element can be anything, including regular HTML elements, and not ASP.NET controls the ID that should be provided is the clientside ID of the opener.
In a regular ASPX page the ID of a control happens to correspond to the clientside ID - so the window is able to find the button on the client in scenario #1.
However, in a master page the ID of the button is different from the clientside ID. As a result, the window is not able to find the button on the client, it does not associate an onclick handler, and when you click on the button it performs a regular postback - because it is a ASP.NET button and this is its default behavior.
What you need to do is make sure that you assign a valid clientside ID to the window
Tervel
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
The OpenerElementID property of RadWindow is provided for ease of developers who wish to associate a window with an opener without writing any code. However, since an opener element can be anything, including regular HTML elements, and not ASP.NET controls the ID that should be provided is the clientside ID of the opener.
In a regular ASPX page the ID of a control happens to correspond to the clientside ID - so the window is able to find the button on the client in scenario #1.
However, in a master page the ID of the button is different from the clientside ID. As a result, the window is not able to find the button on the client, it does not associate an onclick handler, and when you click on the button it performs a regular postback - because it is a ASP.NET button and this is its default behavior.
What you need to do is make sure that you assign a valid clientside ID to the window
- either by associating it in the codebehind,
- or by using an expression such as OpenerElementID="<%# Button1.ClientID%>"
- or by simply using a regular clietside button without runat=server attribute, e.g
<button id="Button1">Button</button> or <input type="button" id="Button1" value="Button">
Tervel
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Zachary
Top achievements
Rank 1
answered on 29 Feb 2008, 02:17 PM
Thank you so much for your help. I didn't understand the ClientID part although I have seen it in some other forums responses. That just made everything click for me.
All I changed was as instructed:
<%# Button1.ClientID%>
And now my RadWindow works perfectly!
Thanks again.
All I changed was as instructed:
<%# Button1.ClientID%>
And now my RadWindow works perfectly!
Thanks again.