javascript does not run properly when called from ASP:Button object

I am calling a javascript object from an ASP button using OnClientClick.  the javascript gets called (added an alert to test) but does not run...  the funny thing is if a create an html input button, the script runs as expected.  
here are the buttons...
<asp:Button runat ="server" ID="btnLookupCustomer" Visible="true" Text="Lookup Customer" Enabled="false" OnClientClick="openPopUp();" />
<input type="button" id="test" value="Lookup Customer1" onclick="openPopUp();" />

Open in new window

and the javascript...
 function openPopUp() {
        alert("i'm here");{ iframe: "CustomerSelectPopup.aspx", close: true, width: 700, height: 600 });

Open in new window

I don't understand why it would work with one control and not the other.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jfb1126Author Commented:
also tried adding  UseSubmitBehavior="false" to the asp control with no avail...
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
I'm not a .NET dev but your asp code runs on the server before the page loads.  Your javascript runs on the client, after the page loads.

The best thing to do is to have the experts look at your rendered page.  Get your page on a public link.  If you are working locally, then just get the sample page somewhere public where it can be seen.  You can also render the html and place the html, css and javascript on or other playground.

More than likely you have a javascript error that is preventing this from working or the supporting files for the pop up are not loaded correctly, or you don't have your js code in a ready function.  It is hard to tell without seeing the full page.
Julian HansenCommented:
Try doing this  (add return before all to openPopUp).
<asp:Button runat ="server" ID="btnLookupCustomer" Visible="true" Text="Lookup Customer" Enabled="false" OnClientClick="return openPopUp();" />

Open in new window

 function openPopUp() {
   alert("i'm here");{ iframe: "CustomerSelectPopup.aspx", close: true, width: 700, height: 600 });
   return false;

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

As julianH wrote, return false from the code to prevent the button from submitting the form.
UseSubmitBehavior is not used to prevent a postback, only to change how the postback is done.
Jfb1126Author Commented:
adding the return to the call worked.  

thank you,
Julian HansenCommented:
You are welcome - thanks for the points - good luck with your project.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.