Anmol Maitra
Top achievements
Rank 1
Anmol Maitra
asked on 10 Aug 2009, 05:50 PM
Hello,
I am not able to close a radwindow. I tried using the following code but the javascript is not getting invoked. Can someone help me please? Is there something funky going on with Ajax?
<script type="text/javascript">
function GetRadWindow() {
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow;
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
return oWindow;
}
function CloseOnReload() {
GetRadWindow().Close();
}
</script>
//CS Code
//injectscript is a label
InjectScript.Text = "<script type='text/javascript'>CloseOnReload()</" + "script>";
I am not able to close a radwindow. I tried using the following code but the javascript is not getting invoked. Can someone help me please? Is there something funky going on with Ajax?
<script type="text/javascript">
function GetRadWindow() {
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow;
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
return oWindow;
}
function CloseOnReload() {
GetRadWindow().Close();
}
</script>
//CS Code
//injectscript is a label
InjectScript.Text = "<script type='text/javascript'>CloseOnReload()</" + "script>";
4 Answers, 1 is accepted
0
Hi Anmol,
I believe that the following blog post will be of help:
http://blogs.telerik.com/blogs/09-05-05/executing_javascript_function_from_server-side_code.aspx
All the best,
Georgi Tunev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
I believe that the following blog post will be of help:
http://blogs.telerik.com/blogs/09-05-05/executing_javascript_function_from_server-side_code.aspx
All the best,
Georgi Tunev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Princy
Top achievements
Rank 2
answered on 11 Aug 2009, 06:41 AM
Hi Anmol,
I guess you are tring to close the RadWindow from content page (not from the parent page). If so, give a try with following code to invoke the client side function and see whether it is working fine.
C#:
Checkout the folowing link to know more about invoking script from code behind.
InjectScript
Thanks,
Princy.
I guess you are tring to close the RadWindow from content page (not from the parent page). If so, give a try with following code to invoke the client side function and see whether it is working fine.
C#:
| ScriptManager.RegisterStartupScript(this, this.GetType(), "closeWindow", "CloseOnReload();", true); |
Checkout the folowing link to know more about invoking script from code behind.
InjectScript
Thanks,
Princy.
0
mark baer
Top achievements
Rank 1
answered on 26 Apr 2011, 09:11 PM
I am trying to close a RadWindow given the code listed above and I get a Javascript error on GetRadWindow. It says that is is null/not an object. See HTML and code behind below.
HTML:
Code Behind that calls the Javascript(upon save inside the RadWindow)...
HTML:
<P><%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %><BR><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %><BR><asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server"><BR></asp:Content><BR><asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"><BR> <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"><BR> <script type="text/javascript"><BR> function refreshGrid(arg) <BR> {<BR> //--------------------------------------------------------------------<BR> //should send Ajax Request to the Page to refresh the Credits Grid...<BR> //--------------------------------------------------------------------<BR> window["<%=radgridCredits.ClientID %>"].AjaxRequest('<%= radgridCredits.UniqueID %>', 'Rebind');<BR> alert('just refreshed the grid');<BR> }<BR> function CloseAndRebind() {<BR> alert('Closing window now');<BR> GetRadWindow().Close();<BR> GetRadWindow().BrowserWindow.refreshGrid(null);<BR> }<BR> function GetRadWindow() <BR> {<BR> try <BR> {<BR> var oWindow = null;<BR> if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog<BR> else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz az well)</P> <P> return oWindow;<BR> }<BR> catch (err) {<BR> alert('Error getting RadWindow: ' + err.Message);<BR> return;<BR> }<BR> }<BR> </script><BR> <BR> </telerik:RadScriptBlock><BR> <telerik:RadSplitter ID="RadSplitter1" runat="server" Width="100%" Height="100%"<BR> Skin="WebBlue"><BR> <telerik:RadPane ID="RadPane1" runat="server" Width="100%" Height="100%" Style="position: relative;"><BR> <asp:Panel ID="panelSearchResultsAndDetails" runat="server"><BR> <!--Search Results and Details--><BR> <telerik:RadPanelBar ID="RadPanelBar1" runat="server" Skin="WebBlue" Width="100%"><BR> <Items><BR> <telerik:RadPanelItem runat="server" Expanded="false" Text="Talent Search Results"><BR> <ContentTemplate><BR> <table width="100%"><BR> <tr><BR> <td align="right" class="formLabel"><BR> <asp:CheckBox ID="ckHideSearchResultsFilter" AutoPostBack="true" runat="server" Text="Hide Filter Row"<BR> OnCheckedChanged="ckHideSearchResultsFilter_CheckChanged" /><BR> <asp:CheckBox ID="ckHideSearchResultsGroupPanel" AutoPostBack="true" runat="server"<BR> Text="Hide Grouping Row" OnCheckedChanged="ckHideSearchResultsGroupPanel_CheckChanged" /><BR> </td><BR> </tr><BR> </table><BR> <telerik:RadGrid ID="radgridSearchResults" runat="server" AllowFilteringByColumn="True"<BR> AllowPaging="True" PageSize="100" AllowSorting="True" AutoGenerateColumns="False" Height="625px"<BR> GridLines="None" ShowGroupPanel="True" Skin="WebBlue" Width="100%" EnableLinqExpressions="false"<BR> OnSelectedIndexChanged="radgridSearchResults_SelectedIndexChanged" OnPageIndexChanged="radgridSearchResults_PageIndexChanged"<BR> OnNeedDataSource="radgridSearchResults_NeedDataSource" CellSpacing="0"><BR> <ClientSettings AllowDragToGroup="True"><BR> <Scrolling AllowScroll="True" UseStaticHeaders="True" ScrollHeight="400" /><BR> </ClientSettings><BR> <MasterTableView><BR> <CommandItemSettings ExportToPdfText="Export to Pdf" /><BR> <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"><BR> <HeaderStyle Width="20px" /><BR> </RowIndicatorColumn><BR> <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"><BR> <HeaderStyle Width="20px" /><BR> </ExpandCollapseColumn><BR> <Columns><BR> <telerik:GridButtonColumn CommandName="Select" DataTextField="Name" FilterControlAltText="Filter TalentColumn column"<BR> SortExpression="Name" Text="Select" UniqueName="TalentColumn" HeaderText="Talent"><BR> <HeaderStyle Width="30%" /><BR> <ItemStyle Width="30%" VerticalAlign="Top" /><BR> </telerik:GridButtonColumn><BR> <telerik:GridBoundColumn DataField="Agency.name" FilterControlAltText="Filter column1 column"<BR> HeaderText="Agency" SortExpression="Agency.name" UniqueName="column1"><BR> <HeaderStyle Width="30%" /><BR> <ItemStyle Width="30%" /><BR> </telerik:GridBoundColumn><BR> <telerik:GridBoundColumn DataField="Agent.name" FilterControlAltText="Filter column2 column"<BR> HeaderText="Agent" SortExpression="Agent.name" UniqueName="column2"><BR> </telerik:GridBoundColumn><BR> </Columns><BR> <EditFormSettings><BR> <EditColumn FilterControlAltText="Filter EditCommandColumn column"><BR> </EditColumn><BR> </EditFormSettings><BR> </MasterTableView><BR> <FilterMenu EnableImageSprites="False"><BR> </FilterMenu><BR> <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"><BR> </HeaderContextMenu><BR> </telerik:RadGrid></P> <P> </ContentTemplate><BR> </telerik:RadPanelItem><BR> <telerik:RadPanelItem runat="server" Text="Talent Details" Expanded="true"><BR> <ContentTemplate><BR> <table width="100%" class="form" border="0"><BR> <tr><BR> <td width="350px"><BR> <table width="100%"><BR> <tr><BR> <td class="formLabel-RightAlign"><BR> Talent<BR> </td><BR> <td width="225px"><BR> <asp:TextBox ID="txtTalentName" runat="server" Width="200px" CssClass="textFields"></asp:TextBox><BR> <asp:RequiredFieldValidator ID="valTalentName" runat="server" ControlToValidate="txtTalentName"<BR> Display="None" ErrorMessage="Talent Name is a required field." ValidationGroup="valGroup1"></asp:RequiredFieldValidator><BR> <asp:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" Enabled="True"<BR> TargetControlID="valTalentName" /><BR> </td><BR> </tr><BR> <tr><BR> <td class="formLabel-RightAlign"><BR> Agent<BR> </td><BR> <td><BR> <telerik:RadComboBox ID="cboAgents" runat="server" EmptyMessage="Type to Search..."<BR> EnableAutomaticLoadOnDemand="true" EnableVirtualScrolling="true" ItemsPerRequest="100"<BR> MarkFirstMatch="True" Skin="WebBlue" Width="205px" AutoPostBack="true" OnSelectedIndexChanged="cboAgents_SelectedIndexChanged"><BR> <WebServiceSettings Method="GetAgents" Path="Talent.aspx" /><BR> </telerik:RadComboBox><BR> </td><BR> </tr><BR> <tr><BR> <td class="formLabel-RightAlign"><BR> Agency<BR> </td><BR> <td><BR> <telerik:RadComboBox ID="cboAgencies" runat="server" EmptyMessage="Type to Search..."<BR> EnableAutomaticLoadOnDemand="true" EnableVirtualScrolling="true" ItemsPerRequest="100"<BR> AutoPostBack="true" MarkFirstMatch="True" Skin="WebBlue" Width="205px" OnSelectedIndexChanged="cboAgencies_SelectedIndexChanged"><BR> <WebServiceSettings Method="GetAgencies" Path="Talent.aspx" /><BR> </telerik:RadComboBox><BR> </td><BR> </tr><BR> <tr><BR> <td class="formLabel-RightAlign"><BR> Agency Phone<BR> </td><BR> <td><BR> <asp:TextBox ID="txtAgencyPhone" ReadOnly="true" runat="server" Width="200px" CssClass="textFields"></asp:TextBox><BR> </td><BR> </tr><BR> <tr><BR> <td class="formLabel-RightAlign"><BR> Phone<BR> </td><BR> <td><BR> <asp:TextBox ID="txtPhone" runat="server" ReadOnly="true" Width="200px" CssClass="textFields"></asp:TextBox><BR> </td><BR> </tr><BR> <tr><BR> <td class="formLabel-RightAlign" valign="top"><BR> Comment<BR> </td><BR> <td><BR> <asp:TextBox ID="txtComment" runat="server" Rows="3" TextMode="MultiLine" CssClass="textFields"<BR> Width="200px"></asp:TextBox><BR> </td><BR> </tr><BR> <tr><BR> <td><BR> </td><BR> <td><BR> </td><BR> </tr><BR> </table><BR> </td><BR> <td width="350px" valign="top"><BR> <table width="100%" border="0"><BR> <tr><BR> <td align="left"><BR> <asp:Label ID="Label2" runat="server" CssClass="formLabel" Text="Specialty" Width="125px"></asp:Label><BR> </td><BR> <td><BR> <asp:Label ID="Label1" runat="server" CssClass="formLabel" Text="Target"></asp:Label><BR> </td><BR> <td><BR> <asp:Label runat="server" CssClass="formLabel-RightAlign" Text="Strengths"></asp:Label><BR> </td><BR> </tr><BR> <tr><BR> <td><BR> <asp:CheckBox ID="ckDirector" runat="server" CssClass="formLabel-RightAlign" Text="Director" /><BR> </td><BR> <td align="center"><BR> <asp:CheckBox ID="ckDirectorTarget" runat="server" CssClass="formLabel-RightAlign" /><BR> </td><BR> <td rowspan="5" valign="top"><BR> <telerik:RadListBox ID="lstTargetStrengths" runat="server" Height="125px" CssClass="textFields"<BR> SelectionMode="Multiple" Skin="WebBlue" Width="200px"><BR> </telerik:RadListBox><BR> </td><BR> </tr><BR> <tr><BR> <td><BR> <asp:CheckBox ID="ckProducer" runat="server" CssClass="formLabel-RightAlign" Text="Producer" /><BR> </td><BR> <td align="center"><BR> <asp:CheckBox ID="ckProducerTarget" runat="server" CssClass="formLabel-RightAlign" /><BR> </td><BR> <td><BR> </td><BR> </tr><BR> <tr><BR> <td><BR> <asp:CheckBox ID="ckWriter" runat="server" CssClass="formLabel-RightAlign" Text="Writer" /><BR> </td><BR> <td align="center"><BR> <asp:CheckBox ID="ckWriterTarget" runat="server" CssClass="formLabel-RightAlign" /><BR> </td><BR> <td><BR> </td><BR> </tr><BR> <tr><BR> <td><BR> <asp:CheckBox ID="ckTalentMale" runat="server" CssClass="formLabel-RightAlign" Text="Talent-Male" /><BR> </td><BR> <td align="center"><BR> <asp:CheckBox ID="ckTalentMaleTarget" runat="server" CssClass="formLabel-RightAlign" /><BR> </td><BR> <td><BR> </td><BR> </tr><BR> <tr><BR> <td><BR> <asp:CheckBox ID="ckTalentFemale" runat="server" CssClass="formLabel-RightAlign"<BR> Text="Talent-Female" /><BR> </td><BR> <td align="center"><BR> <asp:CheckBox ID="ckTalentFemaleTarget" runat="server" CssClass="formLabel-RightAlign" /><BR> </td><BR> <td><BR> </td><BR> </tr><BR> <tr><BR> <td><BR> </td><BR> <td><BR> </td><BR> </tr><BR> </table><BR> </td><BR> <td valign="top"><BR> <table width="100%" border="0"><BR> <tr><BR> <td class="formLabel" colspan="2"><BR> <table width="100%"><BR> <tr><BR> <td><BR> Male/Female Talent Attributes<BR> </td><BR> <td align="right"><BR> <telerik:RadButton ID="btnSave" runat="server" Text="Save" OnClick="btnSaveTalent_Click"<BR> Skin="WebBlue" ValidationGroup="valGroup1"><BR> </telerik:RadButton><BR> <telerik:RadButton ID="btnDelete" runat="server" Text="Delete" OnClick="btnDeleteTalent_Click" Skin="WebBlue"><BR> </telerik:RadButton><BR> <telerik:RadButton ID="btnResetTalent" runat="server" Text="Reset" OnClick="btnResetTalent_Click" Skin="WebBlue" ><BR> </telerik:RadButton><BR> <asp:ModalPopupExtender ID="ModalPopupExtender2" runat="server" BackgroundCssClass="modalBackground"<BR> CancelControlID="ButtonCancel" DynamicServicePath="" Enabled="True" OkControlID="ButtonOk"<BR> PopupControlID="panelDeleteTalentOuter" TargetControlID="btnDelete" /><BR> <asp:ConfirmButtonExtender ID="ConfirmButtonExtender2" runat="server" ConfirmText=""<BR> DisplayModalPopupID="ModalPopupExtender2" Enabled="True" TargetControlID="btnDelete" /><BR> </td><BR> </tr><BR> </table><BR> </td><BR> </tr><BR> <tr><BR> <td class="formLabel-RightAlign" width="75px">Age Range:</td><BR> <td><BR> <telerik:RadComboBox ID="cboAgeRanges" runat="server" EmptyMessage="Type to Search..."<BR> MarkFirstMatch="True" Skin="WebBlue" Width="175px" ZIndex="100"><BR> </telerik:RadComboBox><BR> </td><BR> </tr><BR> <tr><BR> <td class="formLabel-RightAlign"><BR> Race:<BR> </td><BR> <td><BR> <telerik:RadComboBox ID="cboRaces" runat="server" EmptyMessage="Type to Search..."<BR> MarkFirstMatch="True" Skin="WebBlue" Width="175px" ZIndex="100"><BR> </telerik:RadComboBox><BR> </td><BR> </tr><BR> <tr><BR> <td class="formLabel-RightAlign"><BR> Type<BR> </td><BR> <td><BR> <telerik:RadComboBox ID="cboTypes" runat="server" EmptyMessage="Type to Search..."<BR> MarkFirstMatch="True" Skin="WebBlue" Width="175px" ZIndex="100"><BR> </telerik:RadComboBox><BR> </td><BR> </tr><BR> <tr><BR> <td><BR> </td><BR> <td class="formLabel"><BR> <asp:CheckBox ID="ckIsAvailable" runat="server" Text="Available" /> <BR> <asp:CheckBox ID="ckInActive" runat="server" Text="Inactive" /><BR> </td><BR> </tr><BR> <tr><BR> <td><BR> </td><BR> <td><BR> </td><BR> </tr><BR> </table><BR> </td><BR> </tr><BR> </table><BR> <!--Credit Table--><BR> <table width="100%" class="form" border="0"><BR> <tr><BR> <td class="formLabel" align="left" valign="baseline" width="100px"><BR> Credits<BR> </td><BR> <td align="left"><BR> <telerik:RadButton ID="btnAddCreditForTalent" Enabled="false" OnClick="btnAddCreditForTalent_Click"<BR> runat="server" Text="Add" Skin="WebBlue"><BR> </telerik:RadButton><BR> </td><BR> <td align="right" class="formLabel" width="95%" valign="baseline"><BR> <asp:CheckBox ID="ckHideCreditsFilterRow" AutoPostBack="true" runat="server" Text="Hide Filter Row"<BR> OnCheckedChanged="ckHideCreditsFilter_CheckChanged" /><BR> <asp:CheckBox ID="ckHideCreditsGroupingRow" AutoPostBack="true" runat="server" Text="Hide Grouping Row"<BR> OnCheckedChanged="ckHideGroupingRow_CheckChanged" /><BR> </td><BR> </tr><BR> <tr><BR> <td colspan="3"><BR> <telerik:RadGrid ID="radgridCredits" runat="server" AllowFilteringByColumn="True"<BR> AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" CellSpacing="0"<BR> GridLines="None" Height="385px" OnNeedDataSource="radgridCredits_NeedDataSource"<BR> OnSelectedIndexChanged="radgridCredits_SelectedIndexChanged" PageSize="100" ShowGroupPanel="True"<BR> Skin="WebBlue" Visible="False" Width="100%"><BR> <ClientSettings AllowDragToGroup="True"><BR> <Scrolling AllowScroll="True" ScrollHeight="375" UseStaticHeaders="True" /><BR> </ClientSettings><BR> <MasterTableView><BR> <CommandItemSettings ExportToPdfText="Export to Pdf" /><BR> <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"><BR> <HeaderStyle Width="20px" /><BR> </RowIndicatorColumn><BR> <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"><BR> <HeaderStyle Width="20px" /><BR> </ExpandCollapseColumn><BR> <Columns><BR> <telerik:GridButtonColumn CommandName="Select" DataTextField="Show.Title" FilterControlAltText="Filter column2 column"<BR> HeaderText="Show" SortExpression="Show.Title" UniqueName="column2"><BR> <HeaderStyle Width="20%" /><BR> <ItemStyle Width="20%" VerticalAlign="Top" /><BR> </telerik:GridButtonColumn><BR> <telerik:GridBoundColumn DataField="Show.Medium.name" FilterControlAltText="Filter TalentColumn column"<BR> FilterControlWidth="50px" HeaderText="Media" SortExpression="Show.Medium.name"<BR> UniqueName="TalentColumn"><BR> <HeaderStyle Width="9%" /><BR> <ItemStyle VerticalAlign="Top" Width="9%" /><BR> </telerik:GridBoundColumn><BR> <telerik:GridBoundColumn DataField="Craft.name" FilterControlAltText="Filter column1 column"<BR> FilterControlWidth="75px" HeaderText="Craft" SortExpression="Craft.name" UniqueName="column1"><BR> <HeaderStyle Width="12%" /><BR> <ItemStyle Width="12%" VerticalAlign="Top" /><BR> </telerik:GridBoundColumn><BR> <telerik:GridBoundColumn DataField="Show.us_bor" DataFormatString="${C:0}" FilterControlAltText="Box Office"<BR> FilterControlWidth="50px" HeaderText="US BO(US$)" SortExpression="Show.us_bor"<BR> UniqueName="colBoxOffice"><BR> <HeaderStyle Width="8%" /><BR> <ItemStyle Width="8%" VerticalAlign="Top" /><BR> </telerik:GridBoundColumn><BR> <telerik:GridBoundColumn DataField="Show.ProdHouse.name" FilterControlAltText="Filter column3 column"<BR> HeaderText="Production House" SortExpression="Show.ProdHouse" UniqueName="column3"><BR> <HeaderStyle Width="15%" /><BR> <ItemStyle Width="15%" VerticalAlign="Top" /><BR> </telerik:GridBoundColumn><BR> <telerik:GridBoundColumn DataField="comment" FilterControlAltText="Filter column4 column"<BR> HeaderText="Comment" SortExpression="comment" UniqueName="column4"><BR> <HeaderStyle Width="15%" /><BR> <ItemStyle Width="15%" VerticalAlign="Top" /><BR> </telerik:GridBoundColumn><BR> <telerik:GridBoundColumn DataField="Show.year" FilterControlAltText="Filter column5 column"<BR> FilterControlWidth="40px" HeaderText="Year" SortExpression="Show.year" UniqueName="column5"><BR> <ItemStyle VerticalAlign="Top" /><BR> </telerik:GridBoundColumn><BR> </Columns><BR> <EditFormSettings><BR> <EditColumn FilterControlAltText="Filter EditCommandColumn column"><BR> </EditColumn><BR> </EditFormSettings><BR> </MasterTableView><BR> <FilterMenu EnableImageSprites="False"><BR> </FilterMenu><BR> <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"><BR> </HeaderContextMenu><BR> </telerik:RadGrid><BR> </td><BR> </tr><BR> </table><BR> <!--Delete Confirm Window--><BR> <asp:Panel ID="panelDeleteTalentOuter" runat="server" CssClass="DeleteConfirmationOuterWindow"<BR> Style="display: none;"><BR> <asp:Panel ID="panelDeleteTalent" runat="server" Width="200px" Height="75px" CssClass="DeleteConfirmWindow"><BR> <table width="100%"><BR> <tr><BR> <td align="center"><BR> Are you sure you want to Delete this Talent?<BR> </td><BR> </tr><BR> <tr><BR> <td align="center"><BR> <asp:Button ID="ButtonOk" runat="server" Text="Ok" /><BR> <asp:Button ID="ButtonCancel" runat="server" Text="Cancel" /><BR> </td><BR> </tr><BR> </table><BR> </asp:Panel><BR> </asp:Panel><BR> <telerik:RadWindowManager ID="RadWindowManager1" Behaviors="Close" runat="server"><BR> <Windows><BR> <telerik:RadWindow ID="radWinAddCredit" runat="server"<BR> Modal="true" Title="Add/Edit Credit" VisibleStatusbar="false"<BR> VisibleOnPageLoad="False" Skin="WebBlue" Height="160px" ShowContentDuringLoad="False"<BR> Width="375px" Behaviors="Close"><BR> <ContentTemplate><BR> <table class="form" width="100%"><BR> <tr><BR> <td class="formLabel-RightAlign" align="left"><BR> Craft<BR> </td><BR> <td><BR> <telerik:RadComboBox ID="cboCrafts" Skin="WebBlue" Width="205px" ZIndex="5000" MarkFirstMatch="true"<BR> EmptyMessage="Type to Select..." runat="server"><BR> </telerik:RadComboBox><BR> <asp:RequiredFieldValidator ID="valCreditCrafts" ControlToValidate="cboCrafts" runat="server"<BR> ErrorMessage="Required" InitialValue="Type to Select..." ValidationGroup="CreditGroup"></asp:RequiredFieldValidator><BR> </td><BR> </tr><BR> <tr><BR> <td class="formLabel-RightAlign"><BR> Title<BR> </td><BR> <td><BR> <telerik:RadComboBox ID="cboShowTitles" Skin="WebBlue" ZIndex="5000" Width="205px"<BR> EnableAutomaticLoadOnDemand="true" EmptyMessage="Type to Search..." MarkFirstMatch="true"<BR> runat="server" EnableLoadOnDemand="True" ItemsPerRequest="100"><BR> <WebServiceSettings Method="GetShowTitles" Path="../Admin/Controls/AdminService.asmx" /><BR> </telerik:RadComboBox><BR> <asp:RequiredFieldValidator ID="valCreditShows" ControlToValidate="cboShowTitles"<BR> runat="server" ErrorMessage="Required" InitialValue="Type to Search..." ValidationGroup="CreditGroup"></asp:RequiredFieldValidator><BR> </td><BR> </tr><BR> <tr><BR> <td class="formLabel-RightAlign"><BR> Comment<BR> </td><BR> <td><BR> <asp:TextBox ID="txtCreditComment" CssClass="textFields" runat="server" Width="200px"></asp:TextBox><BR> </td><BR> </tr><BR> <tr><BR> <td align="right" colspan="2"><BR> <telerik:RadButton ID="btnSaveCredit" Skin="WebBlue" runat="server" Text="Save" ValidationGroup="CreditGroup"<BR> OnClick="btnSaveCredit_Click"><BR> </telerik:RadButton><BR> </td><BR> </tr><BR> </table><BR> <asp:Label ID="lblCreditScript" runat="server" Text="" Visible="false"></asp:Label><BR> </ContentTemplate><BR> </telerik:RadWindow><BR> </Windows><BR> </telerik:RadWindowManager><BR> </ContentTemplate><BR> </telerik:RadPanelItem><BR> </Items><BR> </telerik:RadPanelBar><BR> </asp:Panel><BR> </telerik:RadPane><BR> <telerik:RadPane ID="SearchPane" runat="server" Height="100%" Width="20px" Style="position: relative;"><BR> <telerik:RadSlidingZone ID="RadSlidingZone1" runat="server" SlideDirection="Left"><BR> <telerik:RadSlidingPane ID="RadSlidingPane1" EnableDock="false" runat="server" Width="240px" Title="Search" Scrolling="Y"><BR> <!--SEARCH PANEL--><BR> <telerik:RadPanelBar ID="radSearchPanel" runat="server"><BR> <Items><BR> <telerik:RadPanelItem runat="server" Width="240px"><BR> <ContentTemplate><BR> <table class="searchForm" width="215px" border="0"><BR> <tr><BR> <td class="searchSectionLabel"><BR> Name<BR> </td><BR> </tr><BR> <tr><BR> <td> <BR> <asp:TextBox ID="txtTalentSearch" CssClass="textFields" runat="server" TabIndex="0"<BR> Width="200px"></asp:TextBox><BR> </td><BR> </tr><BR> <tr><BR> <td class="searchSectionLabel"><BR> Agent<BR> </td><BR> </tr><BR> <tr><BR> <td><BR> <telerik:RadComboBox ID="cboAgentSearch" runat="server" EmptyMessage="Type to Search..."<BR> EnableAutomaticLoadOnDemand="true" EnableVirtualScrolling="true" ItemsPerRequest="100"<BR> MarkFirstMatch="True" Skin="WebBlue" Width="205px"><BR> <WebServiceSettings Method="GetAgents" Path="Talent.aspx" /><BR> </telerik:RadComboBox><BR> </td><BR> </tr><BR> <tr><BR> <td class="searchSectionLabel"><BR> Agency<BR> </td><BR> </tr><BR> <tr><BR> <td><BR> <telerik:RadComboBox ID="cboAgencySearch" runat="server" EmptyMessage="Type to Search..."<BR> EnableVirtualScrolling="true" ItemsPerRequest="100" EnableAutomaticLoadOnDemand="true"<BR> MarkFirstMatch="True" Skin="WebBlue" Width="205px"><BR> <WebServiceSettings Method="GetAgencies" Path="Talent.aspx" /><BR> </telerik:RadComboBox><BR> </td><BR> </tr><BR> <tr><BR> <td class="searchSectionLabel"><BR> Credit<BR> </td><BR> </tr><BR> <tr><BR> <td><BR> <telerik:RadComboBox ID="cboCreditSearch" runat="server" EmptyMessage="Type to Search..."<BR> EnableVirtualScrolling="true" ItemsPerRequest="100" EnableAutomaticLoadOnDemand="true"<BR> MarkFirstMatch="True" Skin="WebBlue" Width="205px" <BR> ><BR> <WebServiceSettings Method="GetCredits" Path="Talent.aspx" /><BR> </telerik:RadComboBox><BR> </td><BR> </tr><BR> <tr><BR> <td align="left" valign="top" class="searchSectionLabel"><BR> Genre<BR> <BR> <asp:Image ID="imgGenreSearch" runat="server" ImageUrl="~/Images/Search.gif" Visible="false" /><BR> </td><BR> </tr><BR> <tr><BR> <td><BR> <asp:ListBox ID="lstGenreSearch" CssClass="textFields" SelectionMode="Multiple" runat="server"<BR> Width="205px" OnSelectedIndexChanged="SearchListBox_SelectedIndexChanged"<BR> AutoPostBack="true"></asp:ListBox><BR> </td><BR> </tr><BR> <tr><BR> <td align="left" valign="top" class="searchSectionLabel"><BR> Strength<BR> <BR> <asp:Image ID="imgStrengthSearch" runat="server" ImageUrl="~/Images/Search.gif" Visible="false" /><BR> </td><BR> </tr><BR> <tr><BR> <td><BR> <asp:ListBox ID="lstStrengthSearch" CssClass="textFields" SelectionMode="Multiple"<BR> runat="server" Width="205px" OnSelectedIndexChanged="SearchListBox_SelectedIndexChanged"<BR> AutoPostBack="true"></asp:ListBox><BR> </td><BR> </tr><BR> <tr><BR> <td align="left" valign="top" class="searchSectionLabel"><BR> Specialty<BR> <BR> <asp:Image ID="imgSpecialtySearch" runat="server" ImageUrl="~/Images/Search.gif" Visible="false" /><BR> </td><BR> </tr><BR> <tr><BR> <td><BR> <asp:ListBox ID="lstSpecialtySearch" SelectionMode="Multiple" Width="205px" Height="100px"<BR> runat="server" OnSelectedIndexChanged="SearchListBox_SelectedIndexChanged"<BR> AutoPostBack="true"><BR> </asp:ListBox><BR> </td><BR> </tr><BR> <tr><BR> <td class="searchSectionLabel"><BR> <asp:CheckBox ID="chkTarget" runat="server" Text="Target" /><BR> </td><BR> </tr><BR> <tr><BR> <td class="searchSectionLabel"><BR> Note<BR> <BR> <asp:Image ID="imgNoteSearch" runat="server" ImageUrl="~/Images/Search.gif" Visible="false" /><BR> </td><BR> </tr><BR> <tr><BR> <td><BR> <asp:ListBox ID="lstNoteSearch" runat="server" SelectionMode="Multiple" Width="205px" OnSelectedIndexChanged="SearchListBox_SelectedIndexChanged"<BR> AutoPostBack="true"><BR> <BR> </asp:ListBox><BR> </td><BR> </tr><BR> <tr><BR> <td class="searchSectionLabel"><BR> <asp:CheckBox ID="ckAvailableOnlySearch" runat="server" Text="Available Only" /><BR> </td><BR> </tr><BR> <tr><BR> <td class="searchSectionLabel"><BR> <asp:CheckBox ID="ckIncludeInactiveSearch" runat="server" Text="Include Inactive" /><BR> </td><BR> </tr><BR> <tr><BR> <td align="right" class="searchSectionLabel"><BR> <telerik:RadButton ID="btnSearch" OnClick="btnSearch_Click" runat="server" Text="Search"<BR> Skin="WebBlue"><BR> </telerik:RadButton><BR> <telerik:RadButton ID="btnReset" OnClick="btnReset_Click" runat="server" Text="Reset"<BR> Skin="WebBlue"><BR> </telerik:RadButton><BR> </td><BR> </tr><BR> </table><BR> </ContentTemplate><BR> </telerik:RadPanelItem><BR> </Items><BR> </telerik:RadPanelBar><BR> </telerik:RadSlidingPane><BR> </telerik:RadSlidingZone><BR> </telerik:RadPane><BR> </telerik:RadSplitter><BR> <!--WINDOW for ADDING/Updating a CREDIT!!!--><BR> <BR> <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" <BR> Skin="WebBlue"><BR> </telerik:RadAjaxLoadingPanel><BR> <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server"><BR> <AjaxSettings><BR> <telerik:AjaxSetting AjaxControlID="panelSearchResultsAndDetails"><BR> <UpdatedControls><BR> <telerik:AjaxUpdatedControl ControlID="panelSearchResultsAndDetails" <BR> LoadingPanelID="RadAjaxLoadingPanel1" /><BR> </UpdatedControls><BR> </telerik:AjaxSetting><BR> <telerik:AjaxSetting AjaxControlID="radSearchPanel"><BR> <UpdatedControls><BR> <telerik:AjaxUpdatedControl ControlID="RadPanelBar1" <BR> LoadingPanelID="RadAjaxLoadingPanel1" /><BR> </UpdatedControls><BR> </telerik:AjaxSetting><BR> </AjaxSettings><BR> </telerik:RadAjaxManagerProxy><BR></asp:Content></P>Code Behind that calls the Javascript(upon save inside the RadWindow)...
Telerik.Web.UI.RadAjaxManager.GetCurrent(this.Page).ResponseScripts.Add("CloseAndRebind()");<BR>0
Cori
Top achievements
Rank 2
answered on 27 Apr 2011, 01:22 PM
Hello Mark,
From the code you posted, it looks like your trying to use the GetRadWindow method in the page that hosts the RadWindow control. The GetRadWindow method is supposed to be used by the page contained inside of the RadWindow, to obtain a reference to itself. This is the reason it returns null because the page your calling this method is not being displayed inside of a RadWindow.
I hope that explains why you're getting null.
From the code you posted, it looks like your trying to use the GetRadWindow method in the page that hosts the RadWindow control. The GetRadWindow method is supposed to be used by the page contained inside of the RadWindow, to obtain a reference to itself. This is the reason it returns null because the page your calling this method is not being displayed inside of a RadWindow.
I hope that explains why you're getting null.