Data not saving during postback

Discussion in 'ASP .Net' started by =?Utf-8?B?UGF1bCBL?=, Aug 16, 2004.

  1. I have the user selecting a record on one page of the web app I'm working on.
    After they select a record, I save the record into a session variable and
    submit the main page (in another window). In the main page I then set some
    edit boxes to the values contained in the record.

    The only problem with this scenario is that the data is not being saved in
    the edit boxes during the postback. Here's the javascript code I'm using to
    submit the main form:

    window.opener.document.forms["Form1"].submit();
    window.close();

    I was wondering if anyone would be able to offer any suggestions about this
    problem.

    Thanks!
    =?Utf-8?B?UGF1bCBL?=, Aug 16, 2004
    #1
    1. Advertising

  2. =?Utf-8?B?UGF1bCBL?=

    Karl Guest

    If you put a breakpoint in the save method, is it being called? My guess is
    that calling window.opener..submit() indeeds submits the form, but won't let
    the save button's eventhandler get hooked up. You might be able to
    manipulate the __EVENTTARGET hidden field to achieve what you want.

    Karl

    "Paul K" <Paul > wrote in message
    news:...
    > I have the user selecting a record on one page of the web app I'm working

    on.
    > After they select a record, I save the record into a session variable and
    > submit the main page (in another window). In the main page I then set

    some
    > edit boxes to the values contained in the record.
    >
    > The only problem with this scenario is that the data is not being saved in
    > the edit boxes during the postback. Here's the javascript code I'm using

    to
    > submit the main form:
    >
    > window.opener.document.forms["Form1"].submit();
    > window.close();
    >
    > I was wondering if anyone would be able to offer any suggestions about

    this
    > problem.
    >
    > Thanks!
    Karl, Aug 16, 2004
    #2
    1. Advertising

  3. The record is getting saved into a session variable in the child window (via
    the datagrid itemcommand handler). After this a hidden control value is set
    so that client-side javascript knows when to submit the form on the main
    window and close the child window.

    I'm setting the values in the edit boxes during the page load handler in the
    main window. During debugging, the values in the edit boxes are set
    correctly. However, when the page loads there is nothing in the controls.

    What I am wondering is if submitting the form directly is causing problems
    with the postback process.

    "Karl" wrote:

    > If you put a breakpoint in the save method, is it being called? My guess is
    > that calling window.opener..submit() indeeds submits the form, but won't let
    > the save button's eventhandler get hooked up. You might be able to
    > manipulate the __EVENTTARGET hidden field to achieve what you want.
    >
    > Karl
    >
    > "Paul K" <Paul > wrote in message
    > news:...
    > > I have the user selecting a record on one page of the web app I'm working

    > on.
    > > After they select a record, I save the record into a session variable and
    > > submit the main page (in another window). In the main page I then set

    > some
    > > edit boxes to the values contained in the record.
    > >
    > > The only problem with this scenario is that the data is not being saved in
    > > the edit boxes during the postback. Here's the javascript code I'm using

    > to
    > > submit the main form:
    > >
    > > window.opener.document.forms["Form1"].submit();
    > > window.close();
    > >
    > > I was wondering if anyone would be able to offer any suggestions about

    > this
    > > problem.
    > >
    > > Thanks!

    >
    >
    >
    =?Utf-8?B?UGF1bCBL?=, Aug 16, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jay Walker
    Replies:
    2
    Views:
    2,392
    Jay Walker
    Feb 8, 2004
  2. Dahab
    Replies:
    2
    Views:
    456
    Mark Rae
    Oct 5, 2006
  3. Dmitry Korolyov

    Datagrid not updated during delete, but updated during insert and update

    Dmitry Korolyov, Sep 22, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    402
    Dmitry Korolyov
    Sep 22, 2003
  4. Jay Walker
    Replies:
    2
    Views:
    129
    Jay Walker
    Feb 8, 2004
  5. Jay Walker
    Replies:
    2
    Views:
    115
    Jay Walker
    Feb 8, 2004
Loading...

Share This Page