473,434 Members | 1,525 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,434 software developers and data experts.

Issue with showModalDialog in asp.net

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
Nov 19 '05 #1
3 1533
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" <Su****@discussions.microsoft.com> wrote in message
news:57**********************************@microsof t.com...
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

Nov 19 '05 #2
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

Nov 19 '05 #3
use a html button, intead of a submit button (asp:button), they do not post
back.

-- bruce (sqlwork.com)
"Suresh" <Su****@discussions.microsoft.com> wrote in message
news:57**********************************@microsof t.com...
| 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
Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Simon Storr | last post by:
Is it possible to make the parent window refresh when a modal dialog is closed? I know I can use window.opener.location.reload(true); for a 'normal' window, but this doesn't work for...
2
by: EMW | last post by:
Hi, In my datagrid I have the first column set as a buttoncolumn with linkbuttons. In my code I have some line to color the row the cursor is hovering over and what to do when the user clicks...
6
by: Scott Lee | last post by:
I am displaying an ASP.Net generated form in a popup opened with window.showModalDialog. The form contains DropDownList controls. The first ddl is populated via databinding to a datatable, has...
4
by: MW de Jager | last post by:
I want to call ShowModalDialog(...) from my C# code in the code behind page of my aspx page. I do not want to link this to a button, since I want to first do some checking myself before I call the...
3
by: needin4mation | last post by:
Hi, I have an asp:button that has a ShowModalDialog script attribute added to it. When the ShowModalDialog opens the user is supposed to select some data which is then sent back to the calling...
2
by: Sarah | last post by:
I am using the javascript showModalDialog function to open a file upload window. The function opens a page which contains a usercontrol housing the file upload stuff. The control works fine when...
3
by: johkar | last post by:
Just want a verification of logic. This seems to work for IE and Firefox, but I wonder if it would be a problematic test in any of the other latest browsers? Is the use of the "window" object...
6
by: David | last post by:
Hi all, I am opening a webform with showModalDialog. This appears to pop-up fine, though I have a problem... Inside the webform is a treeview control. When the treeview is populated, I am...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.