473,406 Members | 2,387 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,406 software developers and data experts.

how to have return key cause postpack?

I want the Return Key to do a postback of an ASP.Net form. What's the
right way to set that up?? I don't want to interfere with the asp.net
framework.
I guess my options are to set the ACTION attribute or inject some
javascript.
This is under 1.2, not 2.0 yet.
Thanks
Dec 20 '05 #1
2 1084
Add a hidden submit button:
<input type=submit style="display:none">
and make sure it is the first button on the form. Hitting Enter will have
the same effect as clicking this button. It will cause a postback.

Eliyahu

"ChrisA" <Ch****@discussions.microsoft.com> wrote in message
news:BB**********************************@microsof t.com...
I want the Return Key to do a postback of an ASP.Net form. What's the
right way to set that up?? I don't want to interfere with the asp.net
framework.
I guess my options are to set the ACTION attribute or inject some
javascript.
This is under 1.2, not 2.0 yet.
Thanks

Dec 20 '05 #2
Eliyahu,
Thanks for the reply. This does postback, but seems to be interpreted as
the click on the 1st Visible button on the form. The framework seems to be
searching for a good button to fire.
The solution was to use an ImageButton, with zero Width/Height, as the
first thing on the form.
-- Chris

"Eliyahu Goldin" wrote:
Add a hidden submit button:
<input type=submit style="display:none">
and make sure it is the first button on the form. Hitting Enter will have
the same effect as clicking this button. It will cause a postback.

Eliyahu

"ChrisA" <Ch****@discussions.microsoft.com> wrote in message
news:BB**********************************@microsof t.com...
I want the Return Key to do a postback of an ASP.Net form. What's the
right way to set that up?? I don't want to interfere with the asp.net
framework.
I guess my options are to set the ACTION attribute or inject some
javascript.
This is under 1.2, not 2.0 yet.
Thanks


Dec 20 '05 #3

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

Similar topics

1
by: Tung Wai Yip | last post by:
I've build the following utility. It works so far but I want to make sure I'm doing the right thing. I am running Python 2.3 on windows 2000. def execute(cmd): """ execute cmd in sub-process,...
2
by: junky_fellow | last post by:
The main() function of my C program is doing some system calls. If any of my system call fails, I want to terminate the program and propagate the exact cause of exit (the error number) to the...
2
by: Mike | last post by:
I keep running into the scenario below over and over again. Currently I get around not having covariant return types by using an interface and explicit property definitions which works to some...
16
by: Nikolay Petrov | last post by:
How can I return multiple values from a custom function? TIA
4
by: Michael Nemtsev | last post by:
I've seen a lot of times using return value in parentesises - { .... return (true); } What's the reason for this? Can smb explait it? PS: they do return predefined values, not calculated ...
20
by: lovecreatesbeauty | last post by:
Hello experts, Is the following code snippet legal? If it is, how can exit() do the keyword return a favor and give a return value to the main function? Can a function call (or only this...
8
by: WakeBdr | last post by:
I'm writing a class that will query a database for some data and return the result to the caller. I need to be able to return the result of the query in several different ways: list, xml,...
13
by: alvin.yk | last post by:
Hi, Normally, a piece of code such as <a href="http://www.yahoo.com" onclick="alert('hello');return false;">link</a> will stop the browser from actually going to href's destination....
8
by: sss.zhou | last post by:
Question about reference of the function return object. class A { public: std::string getString() const { return str_; } private:
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.