Returning to Parent page with refreshed New Data
Some desperate help please!
I have an individual with details of their company. I want reassign the individual to a different company which brings up a dialog box .I do a look up of the company with dialog box, if it's not there I create it. When clicking on the save button it creates this new company and should refresh the parent page with the new details. I have it all working up until I create the company, but do not know how to return to the parent page with the refreshed data.
I have a bit of script that could work but do not know how to implement it into the button_save function in C#.
Dim mstrScript As String
mstrScript = "<script>"
mstrScript = mstrScript & "window.opener.document.forms(0).submit();"
mstrScript = mstrScript & "window.close();"
mstrScript = mstrScript & "</script>"
Page.RegisterStartupScript("ClientScript", mstrScript)
This is what my button save function looks like at the moment:
public void ButtonSave_OnClick(Object sender, EventArgs e)
{
TblOrganisation sourceObject = new TblOrganisation();
AssignValues(ref sourceObject);
if (this.Page.IsValid
&& this.Page.ErrorBox.MessageCount == 0)
{
sourceObject.BlnDeleted = "N";
sourceObject.DteCreated = DateTime.Now;
sourceObject.StrCreatedBy = ThisPortal.CurrentUser.Name;
sourceObject.Insert();
TblLog.WriteEvent(sourceObject.IntOrganisationID, MemeType.Organisation, "Organisation created", sourceObject.IntOrganisationID, MemeType.Organisation, sourceObject.StrOrganisationName);
this.Page.MessageBox.ShowMessage("Organisation has been created.");
this.Activator.ReferencedObjectIntID = sourceObject.IntOrganisationID;
this.Activator.Activate();
}
else
{
this.Page.ErrorBox.ShowMessages(ThisSystem.Diction ary["Message.ErrorsFound"]);
}
}
Thanks in advance.
|