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. General Programming
  3. Visual Studio
  4. popup window and postback

popup window and postback

Scheduled Pinned Locked Moved Visual Studio
questiondatabaseannouncement
2 Posts 2 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.
  • V Offline
    V Offline
    Vipin d
    wrote on last edited by
    #1

    hi all, in my application i ve a datagrid in that a hyper link column "details" datagrid conatin student id , name , class when i click that hyperlink "details" a new window is opened with full details of that student(ie full name, address, location age dob...) and a button named as update in that new popup window i can change student datils and when press the update button it is updated in the database. up to this ok. my need is after updating databse the popup window is closed and control back to the parent page and its datagrid contain the updated details. now it is happend only after a post back or any other button click, my question is how i can automatically post back when the popup window closed and focus come back to the parent page? any soln for this situation? urgent:) All I ever wanted is what others have.... CrazySanker

    O 1 Reply Last reply
    0
    • V Vipin d

      hi all, in my application i ve a datagrid in that a hyper link column "details" datagrid conatin student id , name , class when i click that hyperlink "details" a new window is opened with full details of that student(ie full name, address, location age dob...) and a button named as update in that new popup window i can change student datils and when press the update button it is updated in the database. up to this ok. my need is after updating databse the popup window is closed and control back to the parent page and its datagrid contain the updated details. now it is happend only after a post back or any other button click, my question is how i can automatically post back when the popup window closed and focus come back to the parent page? any soln for this situation? urgent:) All I ever wanted is what others have.... CrazySanker

      O Offline
      O Offline
      OMalleyW
      wrote on last edited by
      #2

      When you open a new window you have the ability to force execution of code on the parent. What you will need is the ability to force a post back event. Add a hidden button to your form. Click on the button and create the click event. The method that will be executed will reload the data for your datagrid. Now Add the following to your first page. function reloadInformation() { __doPostBack('btn1','Click'); } Like I said the click event will reload the data. Now on your popup page. We are going to need to execute some script once your update had run. To do that we will use the Page.RegisterClientScriptBlock event. private void btn1_Click(object sender, System.EventArgs e) { string scriptString = ""; // do work // ...... // // scriptString = "" + Environment.NewLine + "window.parent.execScript('reloadInformation()')" + Environment.NewLine + ""; Page.RegisterClientScriptBlock("clientscript",scriptString); } References: registerclientscriptblock[^] Window Object[^] Hope this points you in the right direction.. Will I hate users. Not all of them, just the ones who talk.CP member: Al Einstien

      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