Javascrip call interferes with OnClick settings

Discussion in 'Software' started by MindofZiggi, Jul 24, 2008.

  1. MindofZiggi

    MindofZiggi

    Joined:
    Jul 24, 2008
    Messages:
    2
    Likes Received:
    0
    Location:
    Maidenhaed, UK
    Hi, I don't know if anyone can help but this problem is driving me nuts.

    In ASP.NET I have a grid of 9 ImageButtons, most of which have a function behind them started by the OnClick setting. One buttun need to open a new windows so I call a small bit of Javascript via the PostBackURL parameter. ALL is fine until you click the Javascript button, yes the new windows opens without a problem, but then after all the button on the page do the same as the Javascript button!!!

    Has anyone else seen this?
    Thanks
     
    MindofZiggi, Jul 24, 2008
    #1
    1. Advertisements

  2. MindofZiggi

    MindofZiggi

    Joined:
    Jul 24, 2008
    Messages:
    2
    Likes Received:
    0
    Location:
    Maidenhaed, UK
    The answer

    OK, well no one came up with the answer, but I get help else where so the solution is:-

    The error was because the dopostback method was trying to run a function on the asp page, instead of
    a client side javascript function, instead you should have used OnClientClick

    Thanks
     
    MindofZiggi, Jul 25, 2008
    #2
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.