Click here to Skip to main content
15,924,196 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: How to stop text_changed event on a particular button click Pin
Anurag Gandhi5-Oct-09 22:37
professionalAnurag Gandhi5-Oct-09 22:37 
GeneralRe: How to stop text_changed event on a particular button click Pin
amittinku5-Oct-09 22:44
amittinku5-Oct-09 22:44 
GeneralRe: How to stop text_changed event on a particular button click Pin
Christian Graus5-Oct-09 23:48
protectorChristian Graus5-Oct-09 23:48 
GeneralRe: How to stop text_changed event on a particular button click Pin
amittinku6-Oct-09 0:03
amittinku6-Oct-09 0:03 
GeneralRe: How to stop text_changed event on a particular button click Pin
Christian Graus6-Oct-09 0:19
protectorChristian Graus6-Oct-09 0:19 
GeneralRe: How to stop text_changed event on a particular button click Pin
amittinku6-Oct-09 0:20
amittinku6-Oct-09 0:20 
GeneralRe: How to stop text_changed event on a particular button click Pin
Christian Graus6-Oct-09 1:05
protectorChristian Graus6-Oct-09 1:05 
AnswerRe: How to stop text_changed event on a particular button click Pin
Arindam Tewary6-Oct-09 7:03
professionalArindam Tewary6-Oct-09 7:03 
This happens because in asp textbox if AautoPostBack is set to true, page is posted back when user leaves the control ( here textbox). So basically, when you click the button, first you leave the textbox control and then you click on the button. Hence TextBox' postback the data to server and as the page is reloaded you dont see any alert message. Subsequent click on button shows the alert message.

I just replicated your situation.

<asp:TextBox ID="TextBox1" runat="server" AutoPostBack="true" ontextchanged="TextBox1_TextChanged"></asp:TextBox>
        <input type="button" id="btnOK" value="OK" onclick="return Button1_onclick();"/>


<script language="javascript" type="text/javascript">
    function Button1_onclick() 
    {
        alert('clicked button');
        return false;
    }
    </script>


Thanks,
Arindam D Tewary

GeneralRe: How to stop text_changed event on a particular button click Pin
Christian Graus6-Oct-09 10:08
protectorChristian Graus6-Oct-09 10:08 
GeneralRe: How to stop text_changed event on a particular button click Pin
amittinku7-Oct-09 16:57
amittinku7-Oct-09 16:57 
Questionshared variable Pin
Blikkies5-Oct-09 21:39
professionalBlikkies5-Oct-09 21:39 
AnswerRe: shared variable Pin
Amit Patel19855-Oct-09 21:44
Amit Patel19855-Oct-09 21:44 
GeneralRe: shared variable Pin
Blikkies5-Oct-09 21:48
professionalBlikkies5-Oct-09 21:48 
GeneralRe: shared variable Pin
nagendrathecoder5-Oct-09 21:59
nagendrathecoder5-Oct-09 21:59 
GeneralRe: shared variable [modified] Pin
Blikkies5-Oct-09 22:03
professionalBlikkies5-Oct-09 22:03 
GeneralRe: shared variable Pin
nagendrathecoder5-Oct-09 22:05
nagendrathecoder5-Oct-09 22:05 
GeneralRe: shared variable Pin
Blikkies5-Oct-09 22:09
professionalBlikkies5-Oct-09 22:09 
GeneralRe: shared variable Pin
nagendrathecoder5-Oct-09 22:13
nagendrathecoder5-Oct-09 22:13 
GeneralRe: shared variable Pin
Blikkies5-Oct-09 22:23
professionalBlikkies5-Oct-09 22:23 
GeneralRe: shared variable Pin
nagendrathecoder5-Oct-09 22:39
nagendrathecoder5-Oct-09 22:39 
GeneralRe: shared variable Pin
Thanigainathan.S6-Oct-09 3:15
Thanigainathan.S6-Oct-09 3:15 
AnswerRe: shared variable Pin
Christian Graus5-Oct-09 23:55
protectorChristian Graus5-Oct-09 23:55 
GeneralRe: shared variable Pin
Blikkies6-Oct-09 1:57
professionalBlikkies6-Oct-09 1:57 
GeneralRe: shared variable Pin
Christian Graus6-Oct-09 10:11
protectorChristian Graus6-Oct-09 10:11 
Questionrepearter control in asp.net Pin
paya1pa5-Oct-09 21:33
paya1pa5-Oct-09 21:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.