Yesterday I wrote about issue with Ajax postbacks in application I am working currently. Problem was with buttons that was triggering UpdatePanels
to update asynchronously. After adding loading indicator I wanted to add error handling at client side. Continue reading “Handling Ajax errors in ASP.NET”
Global UpdatePanel loading indicator in ASP.NET
When I started working on application I am working right now, one of first things I noticed, that was not entirely wrong but was inconvenient: when user clicked on some button that triggers update panel you was not entirely sure it worked or not. Why? Because of three things: Continue reading “Global UpdatePanel loading indicator in ASP.NET”
Better algorithm for finding UpdatePanel that will be updated during page request.
Other day I was experimenting with finding which UpdatePanel will be updated during page post back.
I found out that my solution was not working correctly for complex triggers, like user controls with custom events, which will trigger async postbacks and update of panel.
Or for grids with buttons. It was big issue. Also it was not pointing to correct UpdatePanel
if name of control was not entirely unique (for example when you have multiple same custom controls on page). It would return first panel, even if it wasn’t updating. Continue reading “Better algorithm for finding UpdatePanel that will be updated during page request.”
Display message on client from anywhere in code with ASP.NET
When I was working with WinForms application in previous work I have found one of most useful feature, ability to show some message to the client. For example user cannot edit some entity in particular time (it is being edited by someone else) or should change password because it will expire in x days. I wanted to do something similar in my web application. Continue reading “Display message on client from anywhere in code with ASP.NET”
Getting private field or property from object
Yesterday I was playing with finding all UpdatePanel
controls on page during generating response in ASP.NET. Since object with this information is private itself and collection of panels is private in that object, I had to write some code to extract that data. I ended up with to extension methods for Object
type, for getting private field an private property. It’s pretty straightforward, besides one thing: since member is private. And we don’t know in witch type exactly (every type in base/descendant hierarchy have it’s one private members) we have to search them all. So this is final code: Continue reading “Getting private field or property from object”