This is a migrated thread and some comments may be shown as answers.

RadWindow Issue

1 Answer 77 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Lokesh
Top achievements
Rank 1
Lokesh asked on 14 Dec 2010, 07:08 AM
Hi Team,
I am having trouble when opening the popup (i.e. radwindow) from server side.
On client side of parent page, I have :

<div id="RestrictionZone" class="module" style="margin-top: 4px; height: 300px; width: 400px;">
  <telerik:RadWindowManager ID="RadWindowManager1" runat="server" style="z-index:7001">
     <Windows>
    <telerik:RadWindow runat="server" ID="RadWindow1" ReloadOnShow="true" ShowContentDuringLoad="true" Modal="true" Height="620px" Width="620px" NavigateUrl="ManageStatusChange.aspx"  />
    </Windows>
</telerik:RadWindowManager>
</div>

and On button click event, I want to open radwindow from server side.
This is what I have on server side.

protected void btnStatus_Click(object source, EventArgs e)
{
StringBuilder oStringBuilder = new StringBuilder();
                oStringBuilder.Append("ManageStatusChange.aspx?EntityID=")
                 .Append(GlobalConstants.COA_BUDGET_SECONDARY_ENTITY_ID)
                 .Append("&SessionString=" + Session["SessionString"] + "&EntityType=COABudgetSecondaryEntity");
OpenModalDialog(this, "Msg", "Key", oStringBuilder.ToString());
Session["SessionString"] = null;
}
  
  
public void OpenModalDialog(System.Web.UI.Page ObjPage, string strMsg, string strKey, string url)
        {
            string strScript;
            Type jsType = ObjPage.GetType();
            ClientScriptManager CS = ObjPage.ClientScript;
            strScript = "javascript:window.radopen(\"" + url + "\",); return true";
            /*System.Web.UI.ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "btnStatus_Click", strScript, true);*/
  
  
Telerik.Web.UI.RadWindow newwindow = RadWindow1;
            newwindow.ID = "RadWindow1";
            newwindow.Height = 620;
            newwindow.Width = 620;
            newwindow.NavigateUrl = url;
            newwindow.VisibleOnPageLoad = true;
            newwindow.RegisterWithScriptManager = true;
            RadWindowManager1.Windows.Add(newwindow);
        }

I also have AjaxRequestDelegate on Parent page .

protected void Page_Load(object sender, EventArgs e)
{
RadAjaxManager rjxManager = RadAjaxManager.GetCurrent(this);
            //Create a new delegate to handle the AjaxRequest event   
            rjxManager.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(rjxManagerBudgetEntity_AjaxRequest);
            rjxManager.AjaxSettings.AddAjaxSetting(rjxManager, aspPanel_ProjectBudget);
}
  
  protected void rjxManagerBudgetEntity_AjaxRequest(object sender, AjaxRequestEventArgs e)
        {
            if (e.Argument == "Rebind")
            {
                Session["currentObject"] = null;
                rgProjectBudget.MasterTableView.SortExpressions.Clear();
                rgProjectBudget.MasterTableView.GroupByExpressions.Clear();
                rgProjectBudget.Rebind();                
            }
  
        }

On my Popup page I have a button, which after clicking saves the data and also has some script that will fire my ajax request delegate on Parent page.

On my aspx side of Popup, I have :

function closeRadWindow()   
{
  
    GetRadWindow().Close();     
    
}   
  
 function CloseAndRebind(args) 
 {
  
      GetRadWindow().Close();
      GetRadWindow().BrowserWindow.refreshParent(args);
 }

And on server side button click Event, I have :

protected void btnSave_Click(object sender, EventArgs e)
        {
           
 COABudgetDetails = Request.QueryString["SessionString"].ToString().Split(',');
                    for (int i = 0; i <= COABudgetDetails.Length - 1 && !string.IsNullOrEmpty(COABudgetDetails[i]); i++)
                    {
                        //Retrive Entity Key for Bdgeting else passing the object.
                        if (mEntityID == GlobalConstants.COA_BUDGET_SECONDARY_ENTITY_ID)
                            mCOABudgetDetailID = Convert.ToInt32(COABudgetDetails[i]);
  
                        StatusChangeHistory AllStatusChangeHistory = GetStatusChangeHistory();
                        StatusChangeHistoryEntry AnStatusChangeHistoryEntry = AllStatusChangeHistory.GetItem(mStatusChangeHistoryID);
                        DoSaveStatus(AllStatusChangeHistory, AnStatusChangeHistoryEntry);
  
                    }
string script = "<script>CloseAndRebind('Rebind')</" + "script>";
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "CloseAndRebind", script, false); 
    
            }


My popup opens fine. But my problem is that, when I click save button of Popup, it saves the data, goes to parent page, fires the ajax request, and instead of closing, it reopens itself 3 times.
I dont know where I am going wrong.
Could you please help me out ?

Thanks,
Lok..

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 16 Dec 2010, 05:11 PM
Hello Lokesh,

At this point I can suggest (it's a shot in the dark though) to try setting EnableViewState=false for the RadWindowManager that you are using. If it doesn't help, please open a support ticket and send us a sample project that reproduces your exact setup and the problem itself. This way we will get a better view over your exact scenario and we'll be able to provide you with the most appropriate solution.

Best wishes,
Georgi Tunev
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
General Discussions
Asked by
Lokesh
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or