Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Avoiding Postbacks in ontextchange event

I am using a asp:textbox and it is firing ontextchanged event, and in that event I am binding the value to a session variable. My problem is that it postsback the page everytime, so I want to avoid the postback in that event.

Please assist me in doing the same.

like image 729
user1820124 Avatar asked Dec 01 '25 12:12

user1820124


1 Answers

OnTextChanged is a server event and if you want it fired and your session state updated correctly then the page needs to undergo a postback. Another approach is to use onchange which is a client event and to update your session state via javascript performing an ajax call to your back-end.

like image 199
Konstantin Dinev Avatar answered Dec 03 '25 02:12

Konstantin Dinev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!