Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 22nd, 2005, 08:45 AM
Registered User
 
Join Date: Dec 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.





Similar Threads
Thread Thread Starter Forum Replies Last Post
when page refreshed layout breaks in IE7 socoolbrewster CSS Cascading Style Sheets 1 May 17th, 2008 11:05 PM
Page 85 - Returning Response Data as a String bnicholas BOOK: Beginning Ajax with ASP.NET 0 January 15th, 2007 03:59 PM
The page cannot be refreshed without sending ... toshi Javascript 2 September 26th, 2006 03:00 AM
Data is not refreshed after an insert TomTab ADO.NET 3 January 19th, 2006 12:24 AM
ASPX page not getting refreshed swanand VS.NET 2002/2003 1 September 15th, 2003 09:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.