Hi,
I have a text box based on text box value some label value's changed.So now when i click enter after puting some value in text box my image button fires which i dont want.I only want to fire TextChanged Event when i click enter on that textbox.
Loading
Suthish NairPosted Oct 28, 2010, 1:42 AM
I even dont' know it was a web application..
i just shoot a reply for the post, hoping its a website..
Sam HobbsPosted Oct 27, 2010, 11:32 PM
Apurva MehtaPosted Oct 27, 2010, 10:31 PM
Problem : When user click enter on any part of screen it calls the first Image button to fires and execute the button method.
Solution : What i did i place another image button at first position on aspx page and set its Width="1px" which cannot be seen during runtime and Onclick of this image button i am calling a empty method.So one user click enter it dont fire any other image button.
Suthish NairPosted Oct 27, 2010, 7:21 AM
I suggest to do your calculation on client side using javascript.
And call the javascript function on events like onKeypress, onchange of textbox .. etc..
What calculations your doing?
Sam HobbsPosted Oct 27, 2010, 3:40 AM
Apurva MehtaPosted Oct 27, 2010, 2:18 AM
Sam HobbsPosted Oct 27, 2010, 1:22 AM
Is the textbox a multiline textbox? Do you have that property set? If you understand what that is and are unable to do that due to the requirments of your application, then there are other possiblities. I know what to do using C++ and using the Wiindows SDK but I need to look at what needs to be done for .Net. So please provide the clarification I request above and if you still need help after that then I will try to find the answer.
I will say though that if the problem is that the enter key is causing a button to be clicked, then the answer is not to add a hidden button, the answer is to remove the button from the properties that specify what button to use (click) when the Enter key is used.
Apurva MehtaPosted Oct 27, 2010, 12:37 AM
AshishPosted Oct 26, 2010, 3:57 AM
and then use the onclientclick of the hidden dummy button to retun false and de focus the text box.