If I submit -> update -> then click the X in the radpanel everything works fine. The radpanel on client close event fires and then the update panel updates. Works great!
The problem occurs when I am trying to do an insert to the database in the radpanel and then automatically close it. I dont want the user to have to manually close the window.
btnSubmit1.Attributes.Add("onclick", "CloseRadWindow()");
When I try to attach some javascript to the radwindow to close the window I have found a strange order of procedures that maybe someone else can understand. What happens is that the window closes, the update panel refreshes and then the database updates. I have even verified this in the profiler. So the problem is that the update panel refreshes but the database hasnt updated yet. Is there any other way to do this besides trying to inject the code directly without refreshing the updatepanel? Somehow delay the closing of the radwindow untill it has ran the update function?
Thanks for your time.
function OnClientclose(radWindow)
{
var refreshCalendar = document.getElementById('ctl00_ContentPlaceHolder1_Button1'); refreshCalendar.click();
}
protected void btnRefreshCalendar_Click(object sender, EventArgs e)
{
//reload dataset here;
updatePanel.Update();
}
The problem occurs when I am trying to do an insert to the database in the radpanel and then automatically close it. I dont want the user to have to manually close the window.
btnSubmit1.Attributes.Add("onclick", "CloseRadWindow()");
When I try to attach some javascript to the radwindow to close the window I have found a strange order of procedures that maybe someone else can understand. What happens is that the window closes, the update panel refreshes and then the database updates. I have even verified this in the profiler. So the problem is that the update panel refreshes but the database hasnt updated yet. Is there any other way to do this besides trying to inject the code directly without refreshing the updatepanel? Somehow delay the closing of the radwindow untill it has ran the update function?
Thanks for your time.
function GetRadWindow()
{
var oWindow = null;
if (window.radWindow)
oWindow = window.radWindow;
else if (window.frameElement.radWindow)
oWindow = window.frameElement.radWindow;
return oWindow;
}
function CloseRadWindow()
{
var oWindow = GetRadWindow();
oWindow.Close();
}