Close Browser

prav_roy

Well-known member
Joined
Sep 10, 2005
Messages
70
Location
Mumbai
Programming Experience
1-3
hi,
i have an application.. in which user can make entries.. when they press SAVE button entries should be saved in the database.. and browser should close..
i used following line of code after saving the entries
Response.Write("<script>window.close();</script>")
but problem with this is it ask for confimation which i dont want,,,
can anybody help me on this..
Thank you
 
prav_roy, it sounds like what you need to do is:
1 - the user presses the SAVE button which causes a postback
2 - the server-side vb.net code runs for button_click() where the data is saved to the database.
--- next you want the page to come back then close. do this with the following step---
3 - page.registerstartupscript("closeWindow", "<script>closeWindow();</script>")

You will need to add the closeWindow() function that kulrom provided in your html page in a <script/> block so the when the registerstartupscript action runs it will find the closeWindow() function.
 
Back
Top