How do i close a web form on click of a button?

sha_shivani

Member
Joined
Sep 28, 2006
Messages
11
Programming Experience
1-3
I am working on a web project.I want when i fill all details on a aspx page and click on save button it should display some message that it has been saved.I also want that after i click on the save button it should save and close the form.Pls let me know how can i do that?
 
Write this code and done

Session("globalconnection") = Nothing
Response.Write("<script language='javascript'> { window.opener='x';self.close() }</script>")
 
How about if you want to close one form, but open another? I have an app with 7 forms that make up the whole document. I need to be able to open 1 form, fill in data, close it, then go back to the menu and pick the next form I need to work on. I need to be able to do this especially during EDIT mode where I may only need to work on 1 or 2 particular forms, not all 7.

I tried writing an OnClick function, but that failed miserably, and trying to cast the visible or enabled properties of the LilnkButtons didn't go too well either....

Would something like this work?

Session("FormToOpen") = "~/Mainmenu.aspx"
window.open(FormToOpen)
 
Back
Top