如何从另一个页面后面的代码访问一个ASPX页面
当我的孩子页面中的数据成功保存时,我需要帮助来重新启用父页面的浏览。我该怎么做。请帮助
更新
我有一个带有网格视图的ASPX页面(ADMINCITY)。当我单击此页面中的添加按钮时,它将使用OnClientClick中的以下JavaScript打开一个新的弹出窗口,
function openPopup() {
window.open("CityPop.aspx", "_blank", "WIDTH=500,HEIGHT=300,scrollbars=no, menubar=no,resizable=yes,directories=no,location=no");
}
因此此JavaScript打开了一个新窗口,其中有一个文本框可以保存数据。现在我想要的是,当数据成功保存时,我希望在父页面(AdminCity)中的GridView重新启动/刷新,以便它可以具有我在文本框中添加的数据。 我是新手,有人建议我您可以从弹出窗口页面的代码访问GridView控件,但我不知道该怎么做。
I need help to rebind a gridview of parent page when data in my child page is saved successfully. How can I do it .Please help
Update
I have a aspx page(AdminCity) with a grid view . when i click on add button in this page, it opens a new popup window using following JavaScript in OnClientClick
function openPopup() {
window.open("CityPop.aspx", "_blank", "WIDTH=500,HEIGHT=300,scrollbars=no, menubar=no,resizable=yes,directories=no,location=no");
}
so this JavaScript opens a new window in which there is a textbox to save data. Now what I want is when data is saved successfully, I want the gridview in the parent page(AdminCity) to rebind/refresh so that it can have the data which I added in textbox.
I am Newbie and someone suggested me that you can access gridview control from popup window page's code behind but I dont know how to do it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须分享更多信息。如果那是一些jQuery.ui对话框,甚至是一个引导程序对话框,那就很好。
但是,如果您谈论打开的100%不同的选项卡或浏览器会话?不,不允许。
想想这种情况:
您来我的网站查看可爱的猫图片。但是,然后我的代码会打开任何其他浏览器窗口 - 包括正在使用您的银行业务的窗口。因此,不,您根本无法获得或抓住其他浏览器窗口 - 不允许,因此将是巨大的安全风险。
但是,您当然可以在当前页面上弹出一个窗口-JQuery.ui对话框非常好。但是,几乎在所有情况下,如果您需要(或允许)后背部,则对话框当然会崩溃,因为您谈论的是重载任何平面的页面jane后背包或按钮单击ASP.NET中土地。
因此,您的“父母页面”的意思并不是真正清晰的100%。也许这可能并不意味着一个实际的单独浏览器窗口,如果是这种情况,那么在这种情况下,您很可能能够重新订文或重新加载网格视图。
You have to share more information. If that is some jquery.UI dialog, or even perhaps a bootstrap dialog, then fine.
However, if you talking about a 100% different tab or browser session that you opened? Nope, not allowed.
Think of this case:
You come to my web site to view a cute cat picture. but, then my code goes and looks for any other browser window open - including one that is doing your banking. So, no, you can't get nor grab other browser windows at all - not allowed and as such would be a huge security risk.
However, you can certainly pop a window up on your current page - jquery.UI dialogs are great for this. However, in near all cases, if you need (or allow) a post-back, then the dialog will of course collapse, since you talking about a page re-load for any plane jane post-back or button click in asp.net land.
So, not really 100% clear by what you mean "parent page". It perhaps may well not mean an actual separate browser windows, and if this is the case, then you may well be able to re-fresh or re-load the grid view in such a case.