Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. post to database and close window

post to database and close window

Scheduled Pinned Locked Moved ASP.NET
questiondatabase
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cbmdk
    wrote on last edited by
    #1

    Hi there, i have run into some problems. i have a modaldialog box on my website, displaying some editable data. i want to do so when the save button has been clicked, it sends the data to the database and then closes the IE window without any confirmation. how do i do it? i have a close button on the page as well, can i simulate a click on that one at the end of my code? :)

    J 1 Reply Last reply
    0
    • C cbmdk

      Hi there, i have run into some problems. i have a modaldialog box on my website, displaying some editable data. i want to do so when the save button has been clicked, it sends the data to the database and then closes the IE window without any confirmation. how do i do it? i have a close button on the page as well, can i simulate a click on that one at the end of my code? :)

      J Offline
      J Offline
      Juno EasyDotNet com
      wrote on last edited by
      #2

      Hi, Does not window.close() work to close a modaldialog window? Juno MCSD.NET, MCDBA, MCSE ---------------------------------------------------------- Support Team of EasyDotNet, INC. http://www.EasyDotNet.com DataForm.NET - The most powerful data entry web server control for ASP.NET

      C 1 Reply Last reply
      0
      • J Juno EasyDotNet com

        Hi, Does not window.close() work to close a modaldialog window? Juno MCSD.NET, MCDBA, MCSE ---------------------------------------------------------- Support Team of EasyDotNet, INC. http://www.EasyDotNet.com DataForm.NET - The most powerful data entry web server control for ASP.NET

        C Offline
        C Offline
        cbmdk
        wrote on last edited by
        #3

        yeah, but how should that be executed in the codebehind?

        Z 1 Reply Last reply
        0
        • C cbmdk

          yeah, but how should that be executed in the codebehind?

          Z Offline
          Z Offline
          ZimCoder
          wrote on last edited by
          #4

          You can setup and call Javascript from the code behind and this how setup //call the method that sets up the client side javascript in you page load setupClientScript(); //Add an html attribute to the control that will trigger the javascript //add the html attribute to call the javascript funvtion this.ImageButton1.Attributes.Add("onClick","CloseWindow();"); //this is the method that sets up the Javascript and registers it private void setupClientScript() { string js = @" function CloseWindow() { window.close(); } "; //Register the script //Test if the script function CloseWindow is registered if (!IsClientScriptBlockRegistered("CloseWindow")) { RegisterClientScriptBlock( "CloseWindow", js ); } } zimcoder What Democracy?? Jesus Christ is King and if you do not like... well you can go to hell!

          C 1 Reply Last reply
          0
          • Z ZimCoder

            You can setup and call Javascript from the code behind and this how setup //call the method that sets up the client side javascript in you page load setupClientScript(); //Add an html attribute to the control that will trigger the javascript //add the html attribute to call the javascript funvtion this.ImageButton1.Attributes.Add("onClick","CloseWindow();"); //this is the method that sets up the Javascript and registers it private void setupClientScript() { string js = @" function CloseWindow() { window.close(); } "; //Register the script //Test if the script function CloseWindow is registered if (!IsClientScriptBlockRegistered("CloseWindow")) { RegisterClientScriptBlock( "CloseWindow", js ); } } zimcoder What Democracy?? Jesus Christ is King and if you do not like... well you can go to hell!

            C Offline
            C Offline
            cbmdk
            wrote on last edited by
            #5

            this.ImageButton1.Attributes.Add("onclick","CloseWindow();"); well the onclick is being performed before it adds anything to the database.... it doesn't execute the other codebehind stuff!

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups