Best way to display and fade status message in asp.net?

I am using VSS 2005 and web forms with the AJAX Control Toolkit. I use update panels to save various parts of my form. The problem is that I am updating the user with state settings with either a label or a literal value.

This value is displayed on the form until the page is refreshed. Is there a way to display a message and fade away after a few seconds? Would be a life saver for me =)

I am using VSS 2005, but I don’t think that simple attenuation will require a lot of intellisense with jQuery?

+3
source share
2 answers

With a combination of the jQuery timers plugin and jQuery fadeOut , you can achieve what you want:

$(function() {
    $(this).oneTime(1000, function() {
        $('#book').fadeOut('slow', function() {
        // Animation complete.
        });
    });
});

This will call the function after the DOM is ready (first line). This function will call another function after one second (second line). This other function will cause the item to disappear using the book.

The DOM cannot be “finished” with updateable fields, I don’t know. You can simply make this a normal function (replace the first line with function removeMessage() {and the last line with }. Then add a call to this function in your updatePanel. However, I have not tested it myself.

+2
source
0

Source: https://habr.com/ru/post/1762246/


All Articles