Beginning ASP.NET 4.5.1 in C# and VB by Imar Spaanjaars

Beginning ASP.NET 4.5.1 in C# and VB by Imar Spaanjaars

Author:Imar Spaanjaars
Language: eng
Format: epub, pdf
Published: 2014-03-04T00:00:00+00:00


Back in the user control ContactForm.ascx, scroll down to the end of the control’s markup, and add a <script> element and the following jQuery code that fires when the form is about to be submitted: <script> $(function() { $('form').bind('submit', function() { if (Page_IsValid) { $('#TableWrapper').slideUp(3000); } }); }); // Code from step 5 goes here </script>

Right before the closing </script> tag and after the closing curly brace, parenthesis, and semicolon of the jQuery document ready function, add the following bold piece of JavaScript: }); function pageLoad() { $('.Attention').animate({ width: '600px' }, 3000). animate({ width: '100px' }, 3000).fadeOut('slow'); } </script>

The pageLoad method (which is part of the client-side JavaScript made available by ASP.NET AJAX) serves the same purpose as jQuery’s document ready, with one exception: it also fires after a partial page update, which is what takes place after you submit the form because of the UpdatePanel in the user control.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.