Clo3boo77 Forum Contributor
Joined: 25 Nov 2011 Posts: 36 Location: England
|
Posted: Sat Dec 24, 2011 2:35 am Post subject: north face jackets Cloth on sale to you is good 52 |
|
|
The default button on enter on an ASP.NET form
I haven't really thought about this in a long time,north face jackets, but after searching a bit and finding some really complex solutions, I figured out a way to fire a "click" based on pressing enter in a text field. It works OK in IE and Firefox,north face clearance, which is good enough for me,canada goose outlet, and it only requires one line. EmailTextBox.Attributes.Add("onKeyPress",canada goose online, "javascript:if (event.keyCode == 13) __doPostBack('" + LoginButton.UniqueID + "',north face jackets,'')"); "EmailTextBox" is as you might suspect a text box control, while "LoginButton" is a link button. All it does is render an extra attribute in the rendered tag that checks for a key press,north face clearance, and if it's the enter key,North face outlet, it fires ASP.NET's __doPostBack method with the unique ID of the button that you want to virtually press. That in turn fires off whatever server-side event handlers you've wired up. You could pass in the eventargument as the second parameter in that Javascript if you wanted to. I can't understand why this wasn't included somewhere in v2. They did offer a default button for the entire form,canada goose jackets, but I think that only works if you have actual buttons (I use LinkButtons almost exclusively). You could actually wire up any control name here if you wanted.
This Week’s Link List (January 21, 2011)
moncler uk Cloth on sale to you is good 530
Cloth on sale to you is good 689
Cloth on sale to you is good 434 |
|