popup window close to submit opener window without 'causes validation' happening

Discussion in 'Microsoft ASP .NET' started by Matt Jensen, Dec 16, 2005.

  1. Matt Jensen

    Matt Jensen Guest

    Howdy

    I've got a ASP.NET webform page that pops up a window for a user to make a
    selection. Once they make a selection in this popup window, the form in the
    popup is submitted an update to the DB is fired, the window closes, and the
    opener window's (server) form is submitted (via JavaScript) (so that any
    form changes that were made are retained) and the newly loaded page shows
    the new selections from the popup window.

    However, the newly loaded page also shows any validation messages, which
    whilst not a huge problem, I'd rather not have for cleanliness' sake. What
    can I do via JavaScript to submit the opener form but not have the .NET
    'causes validation' happen?

    Can I use the JavaScript to call some hidden/dummy/zero width button (either
    HTML or .NET), or is there some better method?

    Thanks for any suggestions.
    Cheers
    Matt
     
    Matt Jensen, Dec 16, 2005
    #1
    1. Advertisements

  2. Matt Jensen

    Matt Jensen Guest

    sorted.

    I used a <a href="" runat="server" id="test"
    onclick="javascript:myjavascript();">test</a> to open the popup window.

    I the popup window I used the javascript:

    window.opener.__doPostBack('test','');
    self.close();

    to call the dotnet postback function, specifying my <a> tag as the 'sender',
    hence no "causesvalidation" firing.

    I originally had a asp.net linkbutton however that submitted my page each
    time it was clicked, and which was an unnecessary and annoying superfluous
    page submit, but now this doesn't happen.

    Matt

    "Matt Jensen" <> wrote in message
    news:...
    > Howdy
    >
    > I've got a ASP.NET webform page that pops up a window for a user to make a
    > selection. Once they make a selection in this popup window, the form in
    > the popup is submitted an update to the DB is fired, the window closes,
    > and the opener window's (server) form is submitted (via JavaScript) (so
    > that any form changes that were made are retained) and the newly loaded
    > page shows the new selections from the popup window.
    >
    > However, the newly loaded page also shows any validation messages, which
    > whilst not a huge problem, I'd rather not have for cleanliness' sake. What
    > can I do via JavaScript to submit the opener form but not have the .NET
    > 'causes validation' happen?
    >
    > Can I use the JavaScript to call some hidden/dummy/zero width button
    > (either HTML or .NET), or is there some better method?
    >
    > Thanks for any suggestions.
    > Cheers
    > Matt
    >
     
    Matt Jensen, Dec 16, 2005
    #2
    1. Advertisements

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. Leon
    Replies:
    1
    Views:
    4,396
    Boban Dragojlovic
    Jun 24, 2003
  2. Guest

    Submit Validation causes control to lose value

    Guest, Jul 19, 2004, in forum: Microsoft ASP .NET
    Replies:
    2
    Views:
    155
    Guest
    Jul 19, 2004
  3. Steve Wark

    Window.Opener Creating A Refresh In Parent Window

    Steve Wark, Aug 29, 2004, in forum: Microsoft ASP .NET
    Replies:
    3
    Views:
    495
    bruce barker
    Oct 28, 2004
  4. Etienne Charland

    Reference window.opener after redirecting the popup

    Etienne Charland, Sep 3, 2004, in forum: Microsoft ASP .NET
    Replies:
    5
    Views:
    289
    Rutger Smit
    Sep 4, 2004
  5. Guest
    Replies:
    1
    Views:
    415
    Guest
    Oct 12, 2004
  6. Andrew Bewley via DotNetMonster.com

    window to window communication (window.opener)

    Andrew Bewley via DotNetMonster.com, Feb 3, 2005, in forum: Microsoft ASP .NET
    Replies:
    0
    Views:
    688
    Andrew Bewley via DotNetMonster.com
    Feb 3, 2005
  7. Guest
    Replies:
    1
    Views:
    848
    Guest
    Apr 28, 2005
  8. Timo
    Replies:
    6
    Views:
    444
    Alexey Smirnov
    Jan 14, 2008
Loading...