Issue with showModalDialog in asp.net

Discussion in 'ASP .Net' started by =?Utf-8?B?U3VyZXNo?=, Jan 3, 2005.

  1. Hi,

    I have a button and on click i am calling a script function to invoke a
    dialog argument.
    btnPopup.attributes.add("OnClick","showpopup();return false;")

    Now the problem is that when i press "enter key" in my page(any where in my
    parent page) i get my dialog window.
    how to get rid of this. Is there any other thing i need to write.

    Thanks in advance.
    V Suresh
     
    =?Utf-8?B?U3VyZXNo?=, Jan 3, 2005
    #1
    1. Advertising

  2. Your popup button just happened to be the first button on the form and, as
    such, it became the default one. This means that pressing Enter cause the
    same effect as mouse click on it. To disable the effect you can check event
    object in javascript. If event.type is not "click", don't show the dialog.

    Eliyahu

    "Suresh" <> wrote in message
    news:...
    > Hi,
    >
    > I have a button and on click i am calling a script function to invoke a
    > dialog argument.
    > btnPopup.attributes.add("OnClick","showpopup();return false;")
    >
    > Now the problem is that when i press "enter key" in my page(any where in

    my
    > parent page) i get my dialog window.
    > how to get rid of this. Is there any other thing i need to write.
    >
    > Thanks in advance.
    > V Suresh
     
    Eliyahu Goldin, Jan 3, 2005
    #2
    1. Advertising

  3. One, that I call, issue with ASP.NET is that by utilizing multiple buttons on
    a form , and there is only one submit allowed (posting back to itself), the
    enter key will "click" the first button in tab order.
    I create mulitple buttons on my forms to process different results so I have
    come to grips with disabling the enter key all together until the next
    revision of .NET (I thought I heard that this would be addressed).
    Using in the head area of each page with multiple buttons:
    <Script language=javascript>
    document.onkeydown = doKey;

    function doKey(e) {
    if (event.keyCode==13)return false;
    }
    </script>
    or the MS article discussing a work around:
    http://support.microsoft.com/default.aspx?scid=kb;en-us;813822

    I'm using showModalDialogs, so make sure you also add this to the header:
    <base target="_self">
    <meta http-equiv="Pragma" content="no-cache">


    "Suresh" wrote:

    > Hi,
    >
    > I have a button and on click i am calling a script function to invoke a
    > dialog argument.
    > btnPopup.attributes.add("OnClick","showpopup();return false;")
    >
    > Now the problem is that when i press "enter key" in my page(any where in my
    > parent page) i get my dialog window.
    > how to get rid of this. Is there any other thing i need to write.
    >
    > Thanks in advance.
    > V Suresh
     
    =?Utf-8?B?Q2hyaXM=?=, Jan 3, 2005
    #3
  4. =?Utf-8?B?U3VyZXNo?=

    bruce barker Guest

    use a html button, intead of a submit button (asp:button), they do not post
    back.

    -- bruce (sqlwork.com)


    "Suresh" <> wrote in message
    news:...
    | Hi,
    |
    | I have a button and on click i am calling a script function to invoke a
    | dialog argument.
    | btnPopup.attributes.add("OnClick","showpopup();return false;")
    |
    | Now the problem is that when i press "enter key" in my page(any where in
    my
    | parent page) i get my dialog window.
    | how to get rid of this. Is there any other thing i need to write.
    |
    | Thanks in advance.
    | V Suresh
     
    bruce barker, Jan 3, 2005
    #4
    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. =?Utf-8?B?UGF1bCBL?=

    window.showModalDialog and ASP.NET

    =?Utf-8?B?UGF1bCBL?=, Nov 2, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    7,237
    =?Utf-8?B?UGF1bCBL?=
    Nov 3, 2004
  2. Venkat Chellam

    showmodaldialog and asp.net

    Venkat Chellam, Nov 18, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    5,979
    =?Utf-8?B?eGNvbXBsdXM=?=
    Dec 23, 2004
  3. VV

    showModalDialog and asp.net

    VV, Dec 29, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    3,265
    Curt_C [MVP]
    Dec 29, 2004
  4. Jonathan
    Replies:
    0
    Views:
    215
    Jonathan
    Jul 19, 2004
  5. Kumar

    Window showModalDialog issue

    Kumar, Apr 6, 2005, in forum: Javascript
    Replies:
    0
    Views:
    95
    Kumar
    Apr 6, 2005
Loading...

Share This Page