This is a migrated thread and some comments may be shown as answers.
Can Radwindow tcause postback on cllosing?
3 Answers 24 Views
This is a migrated thread and some comments may be shown as answers.
Rafael
Top achievements
Rank 1
Rafael asked on 27 Jan 2012, 09:39 PM

I have a Radscheduler in a control and I'm using a Radwindow to replace the Delete confirmation. I'm using a window because i needed to save a Note for the reason of deleting. The only problem im having is that i need it to cause a postback on the scheduler to reflect that the Appointment was deleted. I was trying to do it with javascript, here is the code i was using.

On the window i have the following:

on the aspx

function Close() {
var oWindow = GetRadWindow();
oWindow.Close();
//oWindow.BrowserWindow.refreshData(); RadScheduler1
oWindow.BrowserWindow.__doPostBack('ucScheduler1$RadScheduler1', '');
}

on the .cs

protected void btnOK_Click(object sender, EventArgs e)
{
 EAppointment.DeleteAppointment(int.Parse(Request.QueryString["AppID"].ToString()), txtRazon.Text.ToString());
string script = "<script>Close()</" + "script>";
ClientScript.RegisterStartupScript(this.GetType(), "Close", script);
}

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 30 Jan 2012, 10:11 AM
Hello,

Try the following.
JS:
function OnClientClick(sender, args)
   {
      var scheduler = $find("<%= RadScheduler1.ClientID %>");
      __doPostBack('scheduler', '');
   }

Thanks,
Princy.
0
Rafael
Top achievements
Rank 1
answered on 30 Jan 2012, 01:49 PM
The RadScheduler i on another window. The main window contains the radscheduler and it calls a radwindow to confirm if you want to delete and save some notes in the db. With that JS RadScheduler1 is not recognized.
0
Marin Bratanov
Telerik team
answered on 31 Jan 2012, 04:41 PM
Hello Rafael,

I suggest that you examine this help article to call a function from the parent window from the RadWindow. Then in this function you can use __doPostBack() to invoke your functionality. You may also find this article useful in implementing this functionality as it explains the use of the __doPostBack() function in detail. Note that you usually need the unique id of the postback control that you wish to impersonate. Please make sure it is correct. You can also try using this RadWIndow with its ContentTemplate, so that you do not have a separate iframe that makes things complicated.


Regards,
Marin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Asked by
Rafael
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Rafael
Top achievements
Rank 1
Marin Bratanov
Telerik team
Share this question
or