admin管理员组文章数量:1023782
Does anyone know how I can reload an UpdatePanel on my parent C# page from an action on my pop-up page WITHOUT refreshing the entire parent page. My parent page doesn't retain its state in the Url, so the user may have expanded a div here, refreshed a list there, and that parent page state needs to be preserved. All that needs to happen is that an UpdatePanel containing a GridView of 'DomainObjects.Incident' should update/refresh when the user has added a new incident in the pop-up.
Is there a way to wire up events between two different asp pages? Or should I be using javascript?
Does anyone know how I can reload an UpdatePanel on my parent C# page from an action on my pop-up page WITHOUT refreshing the entire parent page. My parent page doesn't retain its state in the Url, so the user may have expanded a div here, refreshed a list there, and that parent page state needs to be preserved. All that needs to happen is that an UpdatePanel containing a GridView of 'DomainObjects.Incident' should update/refresh when the user has added a new incident in the pop-up.
Is there a way to wire up events between two different asp pages? Or should I be using javascript?
Share Improve this question asked Nov 4, 2010 at 2:13 Ralph LavelleRalph Lavelle 5,7694 gold badges39 silver badges47 bronze badges4 Answers
Reset to default 3The only way to do this pletely managed only by code is if you use something like the AjaxControlToolkit to make your popup a modal div in the main page.
Otherwise, you could use javascript in the child and parent page to trigger some postback/callback in the parent page. You can set the postback/callback event as a trigger of your update panel.
You can refresh an UpdatePanel by calling:
__doPostBack('<UpdatePanel ID>', '');
If you want to do this from the child page, you should be able to wrap the call up in a function and call it via JavaScript.
Example:
// Parent Page Refresh Function
function Refresh()
{
__doPostBack('UpdatePanel1', '');
}
//Child Page Trigger
<input type="button" id="button1" onclick="window.opener.Refresh()" value="Refresh Parent" />
You should probably make sure the parent is still open before calling Refresh() by checking "window.opener.closed".
I've not tested this code, so might have a type'o.
Have a look at window.opener
Reference parent window document
JQuery - Write to opener window
My first thought is municate to the parent window to perform the refresh using javascript, you could see what javascript your update panel calls via the page source and use the same.
If there is a chance to use the RadWindow(telerik), then the munication is possible between the parent and the child page.
see the demo http://demos.telerik./aspnet-ajax/window/examples/dialogreturnvalue/defaultcs.aspx
Does anyone know how I can reload an UpdatePanel on my parent C# page from an action on my pop-up page WITHOUT refreshing the entire parent page. My parent page doesn't retain its state in the Url, so the user may have expanded a div here, refreshed a list there, and that parent page state needs to be preserved. All that needs to happen is that an UpdatePanel containing a GridView of 'DomainObjects.Incident' should update/refresh when the user has added a new incident in the pop-up.
Is there a way to wire up events between two different asp pages? Or should I be using javascript?
Does anyone know how I can reload an UpdatePanel on my parent C# page from an action on my pop-up page WITHOUT refreshing the entire parent page. My parent page doesn't retain its state in the Url, so the user may have expanded a div here, refreshed a list there, and that parent page state needs to be preserved. All that needs to happen is that an UpdatePanel containing a GridView of 'DomainObjects.Incident' should update/refresh when the user has added a new incident in the pop-up.
Is there a way to wire up events between two different asp pages? Or should I be using javascript?
Share Improve this question asked Nov 4, 2010 at 2:13 Ralph LavelleRalph Lavelle 5,7694 gold badges39 silver badges47 bronze badges4 Answers
Reset to default 3The only way to do this pletely managed only by code is if you use something like the AjaxControlToolkit to make your popup a modal div in the main page.
Otherwise, you could use javascript in the child and parent page to trigger some postback/callback in the parent page. You can set the postback/callback event as a trigger of your update panel.
You can refresh an UpdatePanel by calling:
__doPostBack('<UpdatePanel ID>', '');
If you want to do this from the child page, you should be able to wrap the call up in a function and call it via JavaScript.
Example:
// Parent Page Refresh Function
function Refresh()
{
__doPostBack('UpdatePanel1', '');
}
//Child Page Trigger
<input type="button" id="button1" onclick="window.opener.Refresh()" value="Refresh Parent" />
You should probably make sure the parent is still open before calling Refresh() by checking "window.opener.closed".
I've not tested this code, so might have a type'o.
Have a look at window.opener
Reference parent window document
JQuery - Write to opener window
My first thought is municate to the parent window to perform the refresh using javascript, you could see what javascript your update panel calls via the page source and use the same.
If there is a chance to use the RadWindow(telerik), then the munication is possible between the parent and the child page.
see the demo http://demos.telerik./aspnet-ajax/window/examples/dialogreturnvalue/defaultcs.aspx
本文标签: javascriptHow can I update a c parent page from a popup page without a full refreshStack Overflow
版权声明:本文标题:javascript - How can I update a c# parent page from a pop-up page without a full refresh - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745568057a2156569.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论