I have a lot of textboxes with the TextChanged event. There is also a master textbox at the top, which if I change it and press a “Change All” button, it changes the entire page of textboxes.
Now, the button exists almost entirely on the client side (just uses jquery to change the textboxes), but I want to know if it has been pressed BEFORE my program runs through the 100+ TextChanged events.
I tried adding a server function for it to set a boolean to true, hoping it would fire first, however, the TextChanged events fire first.
TL;DR I need to tell my program in which order to go through the events after a postback.
You really can’t change the order of events in the ASP.NET page lifecycle…but you might still be able to accomplish what you’re needing. Here’s a suggestion…take it FWIW…
On the client side, you could add a Javascript event handler (or amend one that already exists) to populate a server-side form field with a magic value (doesn’t really matter what). On the postback, inside the Page_Load (and/or in the TextChanged event handlers), check for the presence of the value when IsPostback = true. You might have to wire up (a bunch) of different handlers to make the same check, so this may be too cumbersome, but its at least the seed of an idea, perhaps.
Won’t promise its very elegant, but it should at least get you closer to what you need.