.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

how to close a parent form

Posted By:      Posted Date: September 27, 2010    Points: 0   Category :ASP.Net

how to close a parent form

View Complete Post

More Related Resource Links

SharePoint popup close and refresh parent form



I am using MOSS 2007 and I have a requirement:

The user should be able to create a new quick link on a popup window.  So I have created a custom NewForm.aspx that is a popup.  Now I need that when the data is filled the popup closes and the parent form get refresh.

This is the code for the Save button:  <SharePoint:SaveButton runat="server" ControlMode="New" id="savebutton2" />

I am unable to place javascript in there.  I had been reading a lot of forum but still unable to find an answer.  Please let me know how to achive this.

Thank you




Refresh parent window and close popup window.


Hi All,

I've been spent the last couple hours trying to work on this issue. I an creating Facebook Oauth stuff, when i click on parent window. The popup shows the Facebook login, when i logged in with my details, it redirects to my site. But i need to close this popup after returning and refrsh the parent window.

can you please provide me this kind of stuff. i already spent whole day in this... Sealed Cry

If i could solve this then i will go for another logic but stucked on 1st step.



Javascript to pass var in iframe to parent form

Why doesn't this form work when the button is clicked? It is inside an iframe. I sent the controls to an iframe from  a different website. When I hover my mouse over the Resubmit button, I can see the correct url in my browser bar. (lower left) This is the same one as the save button. Does the fact that the Resbmit button is in an iframe create a problem?  Is this a security issue?   I was trying to use the Copy url to clipboard button to copy the selected url in the dropdown to the clipboard. Then the user could paste it into the Recipcocal url field in the form and click the Save button again. (see picture) The form is on the page with the iframe. The copy button doesn't work either.  <form name="ctl01" method="post" action="http://www.link-exchangers.com/adv_links_addbycustomer.aspx" id="ctl01" target="hdnFrm"> <div> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUaUXIyTcD6f05q0zIbv4QVbpto4s=" /> </div> <div> <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="//2DwKU+M6MDwK8m8+dCQKy8rjSBwLD+aWMBALcwYfHCALrp+eHDwKggI3ODAKvtqqBBgKjs8y4CAKqiLHeDgK34agCBNfAteTeI3XoiXVXjCs/J0yEnNM=" /> </div>

this.controls.add - not always adding to parent form

My current code (snippet below) iterates through user info and adds the same custom control to a form based on how many "Meals" (1-6) the user has selected.  It appears that all even # controls (the second, fourth and sixth) are added to the previously added control, rather than the parent form, when I later try to dispose the controls by iterating through this.controls, only 1, 3 and 5 appear, the others appear as children to 1, 3 & 5. I've reduced controls size, etc. to make sure they're not overlapping (if that can force inheritence?) but no luck.  Anyone have suggestions on what to look at or other guidance? public void drawMealPanel(Meal m, int x, int y) { Controls.MealDisplay md = new Controls.MealDisplay(m); md.Name = m.name; md.Tag = m.id.ToString(); md.Left = x; md.Top = y; md.DragDrop += new System.Windows.Forms.DragEventHandler(this.MealView_DragDrop); md.DragEnter += new System.Windows.Forms.DragEventHandler(this.MealView_DragEnter); this.Controls.Add(md); }

make a form parent to all other forms in visual studio c#

i have created 2 forms child.cs and parent.cs. I have added the menustrip in parent form. I want that menu strip to be displayed in the child form also. How can i do that? Or else I want to make the parent.cs as the common form to my child.cs. Please help me with the coding that i can understand

InfoPath form web part stops the close on submit

I have successfully published HTML browser enabled InfoPath 2010 forms to form libraries in SharePoint 2010. Users can navigate to the libraries and click new docuiment and fill out and submit forms, and the behavior of submit is as programmed in the form namely I have a concat rule for form name and chose action after submit to close the form with a success message. The problem I am seeing is a little abstract so stay with me while I explain. I'm hosting a number links to web part pages with the infopath web part on them. I use a links web part to aggrigate about 16 forms links on a single page. Users can successfully click on a link, are migrated to the web part page that has the form displayed in the infopath web part and all is well till they click the submit (on the ribbon, or custom button or whatever) The form does successfully get saved into the form library, but the form does not close. I need to make this process very simple for users without any training expended on the process. I'd like to shift focus to the previous web page, or close the form or something dramatic visually to show the user that they have completed the form fill out, and allow them to fill another form. Codebehind examples gratefully accepted! /Robin    

Delphi Win32 MDI Parent with C# Windows Forms child form

I have created an assembly containing a form that i want created as a MDI child form in a Delphi Win32 application's MDI parent control. I can create the .NET form fine from my Delphi code. I can even use the Delphi window handle to let my .NET form be a child in the Win32 application by using the SetParent API. However minimizing the child form makes it disappear (instead of the regular minimize action for MDI children), and it also doesn't cause the MDI container to get scroll bars when you drag the child form under the edge of the MDI container. I have the feeling that the child form is not yet correctly aware that it is a MDI child. For instance, its MdiParent property is null. And i read somewhere that i might need to call some more Win32 API"s to hook everything up correctly. I can't, however, for the life of me not find which ones to call, and where to do it. Is there anyone here that is well versed in hooking up managed Windows Forms with native Win32 applications that can lend a helping hand?

Custom Edit form - close modal dialog and navigate to page

Hi, I created one custom edit form for my document library, replaced default save and cancel buttons with input buttons and added the form action to them. Then I set my page as default edit form. When I click edit button, my custom form opens in modal pop up. When I try to save the item by clicking new save button, item gets saved but pop remains as it is. Now, I want the modal pop up to get closed and navigate to page other than the parent page with some parameters after I click save button. How can I achieve this? Thanks!!

How to close a Form...

Hi all, i recently started C++.NET(CLR) and i cant seem to get Form1 to close after Form2 is loaded... after clicking ok button on Form1, Form2 is loaded properly but then i want Form1 to go away.. i tried almost everything, i included the header file of Form1 into Form2 but that just gave me around 6 errors saying that the instance i created of Form2 in Form1 was undeclared, then i removed that and just tried creating an instance of Form1 in Form2 load method but that also just gave errors... Help plz =/

Refresh Parent Page List after Edit Item Modal Dialog Save/Close

I am calling the Edit Item URL (EditForm.aspx?ID=x&IsDlg=1) via javascript code to bring up the Edit Item Modal Dialog. This works fine and dandy. But what callbackfunction should I invoke after the Save so that the parent list is refreshed? Is there a better way to do it than call reload on the entire parent frame? It almost looks like there should be a way to refresh just the list. Any help appreciated. Thanks, Jake.

how to close a form using Jquery

(1) how to Close a Parent Form2 how to close a child form(iframe)

how to close a form,subform,iframe and everthing using jquery


how to close a form,subform,iframe and everthing using jquery

How to access the Parent form Text box in Third iframe


i have 3 iframe how to access the paten(t textbox value=1) in the 3rd iframe

close popup form and open again

when i click a button, then prompt another form and then i click close button at the upper right corner of the form
the popup form is closed
then i click a button again, then prompt a popup form again
but now when is popup form is prompt at second time,it always trigger form_closing event,why?
how to prevent it?

How to close the sharepoint modal dialog and refresh the parent page using Server side API?

I am trying to find a way to close a modal page that has been opened with the click event of ribbon control. Once the modal dialog is opened, I'm showing 'OK' button for the user to confirm some action on the respective list item. If the user clicks on 'OK', I'm performing some action on the listitem using server side code. Here the problem for me is, once the action is completed on this listItem, I need to close the dialog and refresh the parent page (AllItem.aspx) using *sharepoint server side

I'm aware that for closing the dialog we have JS code "SP.UI.ModalDialog.commonModalDialogClose". But this is not useful for me, because I should first run some action on the listitem and once that action is complete, then only I should close this dialog.

Passing values to the parent form



I have two forms, a parent and a child. When I close the child form I need to pass a (bool value?) to the parent form which indicates whether I want to close the parent form as well, or not.

How do I pass this value from the child form to the parent form? Or is there a better way to return a value to a parent form?

I’m using VS 2008 and C#

Kind regards


Programatically close web enabled form after submit


Hi all

I have an InfoPath 2007 form, which is web enabled and deployed to Forms Server 2007.

On the form I have a button. What I want to happen when the button is pressed is this:

1. My custom code behind should be executed. The custom code calls an external aseembly (common to ALL my InfoPath forms) which has a method that includes a dataconnection.Execute which will submit the form.

2. Close the form IF the submit went well.

Currently, I have a code behind and a rule on the button. What I am trying to get working is that the code behind sets a status flag on the form to "Success" and then executes the data connection. If an exception is thrown, I set the status flag to something else ("Failed") and rethrow the exception. In the rule of the button I then check this status field in the condition of the rule and if it is set to Success I close the form. What happens is, that the form is not closed uppon succesfully execution of the data connection. I am not sure in what order the code is run; Is the rule fired first or is the .NET code behind? It appears that the .NET code IS fired... and if the form was closed in the rule, then I wouldn't expect that to happen. So that means the rule is fired last. On the other hand the value set in one of the fields is not present upon validation of the condition of the rule, so tha

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend