Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Issue with showModalDialog in asp.net

Reply
Thread Tools

Issue with showModalDialog in asp.net

 
 
=?Utf-8?B?U3VyZXNo?=
Guest
Posts: n/a
 
      01-03-2005
Hi,

I have a button and on click i am calling a script function to invoke a
dialog argument.
btnPopup.attributes.add("OnClick","showpopup();ret urn 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
 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      01-03-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I have a button and on click i am calling a script function to invoke a
> dialog argument.
> btnPopup.attributes.add("OnClick","showpopup();ret urn 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



 
Reply With Quote
 
 
 
 
=?Utf-8?B?Q2hyaXM=?=
Guest
Posts: n/a
 
      01-03-2005
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...b;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();ret urn 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

 
Reply With Quote
 
bruce barker
Guest
Posts: n/a
 
      01-03-2005
use a html button, intead of a submit button (asp:button), they do not post
back.

-- bruce (sqlwork.com)


"Suresh" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
| Hi,
|
| I have a button and on click i am calling a script function to invoke a
| dialog argument.
| btnPopup.attributes.add("OnClick","showpopup();ret urn 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
refresh parent window on close showModalDialog? Simon Storr ASP .Net 5 07-23-2012 05:35 AM
Window showModalDialog issue Kumar Javascript 0 04-06-2005 12:16 AM
Open showModalDialog from showModalDialog Jonathan Javascript 0 07-19-2004 02:30 PM
closing showModalDialog window from server side jayuya ASP .Net 2 07-15-2003 02:09 PM
Could I use showModalDialog Enosh Chang ASP .Net 0 07-03-2003 07:58 AM



Advertisments