【发布时间】:2014-02-13 03:51:45
【问题描述】:
我的设置很简单。
在Details.aspx 我有一个表单视图和一个按钮。单击该按钮时,它会打开一个 Telerik radwindow 到editdetails.aspx。在editdetails.aspx 我有一个按钮,上面写着提交。我想要做的是关闭打开的 radwindow,然后只刷新details.aspx 上的表单视图。欢迎任何帮助!
details.aspx
<asp:FormView ID="fvDealershipInformation" runat="server" BorderStyle="Solid" BorderWidth="1px">
<HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
<HeaderTemplate>
<div>
<h3>
Dealership Information</h3>
</div>
</HeaderTemplate>
<ItemTemplate>
<table id="tblDealershipInformation" border="0" cellpadding="10" cellspacing="0">
<tr class="formviewCommandRow">
<td>
<asp:ImageButton runat="server" ID="EditFormViewButton" ImageUrl="~/secure/images/edit.jpg"
ToolTip="Edit Dealer Information" OnClientClick="ShowEditDealerInformationForm(); return false;"/>
</td>
<td>
</table>
</ItemTemplate>
</asp:FormView>
这里是ShowEditDealerInformationForm()
function ShowEditDealerInformationForm() {
var url = window.location.search;
url = url.replace("?", ''); // remove the ?
var oWnd = window.radopen("editdetails.aspx?" + url, "UserListDialog");
oWnd.maximize();
}
这会很好地打开editdetails.aspx,所以在editdetails.aspx上我有一个按钮,我想关闭radwindow然后更新information.aspx上的formview
editdetails.aspx
<telerik:RadButton runat="server" ID="UpdateContactInformation" Text="Submit" OnClick="RadButton_DealerContactRecord_Click"
Skin="Web20">
</telerik:RadButton>
protected void RadButton_DealerContactRecord_Click(object sender, EventArgs e)
{
ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CloseAndRebind('navigateToInserted');", true);
}
function CloseAndRebind(args) {
{
GetRadWindow().close();
}
function GetRadWindow() {
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow;
//Will work in Moz in all cases, including clasic dialog
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)
return oWindow;
}
【问题讨论】:
标签: javascript asp.net telerik