Can Radwindow tcause postback on cllosing?

4 posts, 0 answers
  1. Rafael
    Rafael avatar
    13 posts
    Member since:
    Aug 2010

    Posted 27 Jan 2012 Link to this post

    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.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);

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 30 Jan 2012 Link to this post


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

  3. Rafael
    Rafael avatar
    13 posts
    Member since:
    Aug 2010

    Posted 30 Jan 2012 Link to this post

    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.
  4. Marin Bratanov
    Marin Bratanov avatar
    5925 posts

    Posted 31 Jan 2012 Link to this post

    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.

    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
Back to Top