Good Morning All
I am Opening a Page as a Popup i am using Telerik WIndow which has similar functionality when opening a Popup like this
this "myPage.aspx" page has a button that person some updates to the Database on the server side. This is opened as a popup and there is a grid below , so what i want to do after the Update to the Database has happened , i want to refresh the Grid, i have this code
and on the server side i have this
or
My problem here is that it Refresh the page before it does a Database Update, and if it refreshes the page , the Database update ends up not being done.
Thanks
I am Opening a Page as a Popup i am using Telerik WIndow which has similar functionality when opening a Popup like this
function OpenPopUp(val_real, vis) {
var myWidth = 0, myHeight = 0;
if (typeof (window.innerWidth) == 'number') {
//Non-IE
myWidth = window.innerWidth;
myHeight = window.innerHeight;
} else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
} else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
}
myWidth = myWidth / 2 - 150;
myHeight = myHeight / 2 - 50;
window.open('MyPage.aspx?Val=' + val_read, 'width=700,height=160,top=' + myHeight + ',left=' + myWidth)
return false;
}
this "myPage.aspx" page has a button that person some updates to the Database on the server side. This is opened as a popup and there is a grid below , so what i want to do after the Update to the Database has happened , i want to refresh the Grid, i have this code
//This code is used to provide a reference to the radwindow "wrapper"
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 az well)
return
oWindow;
}
function
CloseOnReload() {
//alert("Dialog is about to close itself");
GetRadWindow().close();
RefreshParentPage();
}
function
RefreshParentPage() {
//alert("Dialog is about to reload parent page");
GetRadWindow().BrowserWindow.location.reload();
}
function
RedirectParentPage(newUrl) {
alert(
"Dialog is about to redirect parent page to "
+ newUrl);
GetRadWindow().BrowserWindow.document.location.href = newUrl;
}
function
CallFunctionOnParentPage(fnName) {
alert(
"Calling the function "
+ fnName +
" defined on the parent page"
);
var
oWindow = GetRadWindow();
if
(oWindow.BrowserWindow[fnName] &&
typeof
(oWindow.BrowserWindow[fnName]) ==
"function"
) {
oWindow.BrowserWindow[fnName](oWindow);
}
}
function
RefreshParentPageWithoutWarning() {
GetRadWindow().BrowserWindow.document.forms[0].submit();
}
and on the server side i have this
Response.Write(
"<Script>return RefreshParentPageWithoutWarning();</script>"
)
or
SavetoDB(Values)
ScriptManager.RegisterStartupScript(Page,
Me
.
GetType
(),
""
,
"RefreshParentPageWithoutWarning()"
,
True
)
My problem here is that it Refresh the page before it does a Database Update, and if it refreshes the page , the Database update ends up not being done.
Thanks