Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9117227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:51:23+00:00 2026-06-17T04:51:23+00:00

I am having one Web page(First window). In that page I am having one

  • 0

I am having one Web page(First window). In that page I am having one image button, Which is having OnClientClick event. In that event I call a javascript method as OpenHelpWindow() i.e.

OnClientClick ="OpenHelpWindow()"

Now whenever I clicked that image button the event in the javascript method(OpenHelpWindow()) will get trigger and it will open the New help web window. Its working properly but the problem is, When I press Enter key then also the event will get fire and show me the help window.

Now I want to stop the second window (Help window) opening when the Enter key pressed.

How can I resolve this problem?

My Code for the first web window Image button is,

.aspx code

.
.
<asp:ImageButton ImageUrl="~/Images/help.png" runat="server" ID="ibtnHelp"
                                AlternateText="Help" ToolTip="Help"  OnClientClick="OpenHelpWindow()" />
.
.

Javascript code for OpenHelpWindow() is

function OpenHelpWindow()
{
var newWin = null;
try
 {
    newWin = window.open("../Common/OpenHelpUrl.aspx");
    newWin.focus();
    return false;
 }
finally
 {
    newWin = null;
 }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T04:51:24+00:00Added an answer on June 17, 2026 at 4:51 am

    Your ImageButton is the form’s default button, which means that when the user presses Enter, that button automagically gets “pressed”. This is standard ASP.NET behavior.

    You can change this by adding the following attribute to your <ImageButton.../> tag:

    UseSubmitBehavior="False"
    

    Good luck!

    EDIT

    If this doesn’t work (which it should!), then you can fool the browser by adding an invisible dummy button in your form:

    <asp:Button ID="dummy" runat="server" Text="" OnClientClick="return false;" style="display:none;"/>
    

    and then adding defaultButton="dummy" to your <form />.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on Asp.net MVC3 web application. I'm having one page on which appx.
I'm new in the asp.net . I'm having one web page in asp.net which
My web page is divied into different section in that in one section having
I have web application Project having RPC call. one RPC async is working fine.
I'm creating a small web page using jquery-ui-1.8 which is having a frameset and
I'm having a web page which has a table with only 2 rows and
I'm new to the asp.net. I'm developing one web site which is having diffenent
I'm trying to display a web page which requires one to be logged in
I have a web application having three pages, one is login page, second is
I am having Grails GORM based application.One web service and one website both are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.