Last post Dec 11, 2009 04:35 AM by raja.selvaraju
Dec 11, 2009 01:12 AM|raja.selvaraju|LINK
I have custom control(Textbox and listbox with one control) and a button in a web page. If I changed the text in the textbox and prees enter button, Textchanged is fired and also button click event fired.
I need to avoid the button click event. How can I do this?
Thanks in advance,
Asp .net 3.5
Dec 11, 2009 01:22 AM|satalaj|LINK
you can remove button from your web page. Does it make sense .
Dec 11, 2009 01:31 AM|chintanpshah|LINK
I can't understand your problem. Have you set AutoPostBack="true" for TextBox?
To avoid postback on Button:
Dec 11, 2009 01:46 AM|raja.selvaraju|LINK
Byeee Satalaj.. it great way ,buts it not suit for us. since we like to solve the problem ..not like your way, if problem comes in any control ,simply removing the controls.
Dec 11, 2009 02:34 AM|satalaj|LINK
Can you post your code snippet here ?
Dec 11, 2009 02:52 AM|nimish_soft|LINK
i faced the same prob, what i did was:
i declared a flag as boolean
set that false in page_load
then i set flag=true on textchanged event
and check that is the button click event, if flag=false then execute the code :)
Dec 11, 2009 04:35 AM|raja.selvaraju|LINK
Thanks Nimish , It is working.