Hi Team,
I am having trouble when opening the popup (i.e. radwindow) from server side.
On client side of parent page, I have :
and On button click event, I want to open radwindow from server side.
This is what I have on server side.
I also have AjaxRequestDelegate on Parent page .
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 :
And on server side button click Event, I have :
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..
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..