0

jQuery & ASP.NET UpdatePanel

For some reason jQuery effects / configurations are lost during a partial page postback when using the UpdatePanel.


A good example is when you’re using the jQuery Datepicker plugin. After a partial page postback the date formatting are lost and it revert back to the defaults.


Here is a quick way to work around it:


1. Hook an event to your page’s onload event. In this case I’ve attached the page’s onload event to a JavaScript function called “load”.


<body onload="load()">


2. Call the Sys.WebForms.PageRequestManager.getInstance().add_endRequest() event exposed by ASP.NET and reference the JavaScript function name (the handler method) as parameter. This event is fired when an asynchronous postback is finished and control has been passed back to the browser



//Function called one page load
function load()
{
     Sys.WebForms.PageRequestManager.getInstance().add_endRequest(PostAJAXRefresh);
}

3. Include all jQuery effects in the handler method referenced by add_endRequest(PostAJAXRefresh)


//all jQuery effects need to be placed here again to keep  effects after partial AJAX page postback
            function PostAJAXRefresh()
            {
                //jQuery UI - datepicker
                $(function() {
		            $("#ctl00_ContentPlaceHolder2_txtDateSent").datepicker({ dateFormat: 'm/d/yy' });
		            $("#ctl00_ContentPlaceHolder2_txtDateFrom").datepicker({ dateFormat: 'm/d/yy' });
		            $("#ctl00_ContentPlaceHolder2_txtDateTo").datepicker({ dateFormat: 'm/d/yy' });
	            });

Posted in ASP.NET, HTML, JavaScript, jQuery | No Comments »

1

The “what’s in scope” argument from clients and how to cover yourself.

I’ve been in the contracting / freelancing business for the past 5 years now. Just like everything else in life it has some loopholes and challenges. One of the very first reality factors of freelancing I had to face right from the beginning was to make sure that I have concrete facts to fall back on when things go haywire in a project.


A good example of this is something like “Creative Design and Adjustments”, a phrase like that opens up the door for endless arguments and confusion. What if a specific component within a website requires some creative design and adjustment which is not part of the actual user interface design of the site?


The very first thing that normally comes into debate is whether a specific task, requirement or functionality is within the original scope of deliverables. These debates, arguments or whatever you want to call it can have a big impact on your business relationship with your client.  This can also lead to tension and will most definitely affect your productivity.


The occasional client is quick to tell you that it (Creative Design and Adjustments or anything else for that matter) is part of the scope of work that you quoted for. Clearly your understanding and that of your client’s is not in sync and this is exactly where the arguments and debates start. My only advice to you is to not use any terms or phrases that leaves the back door open for any sort of arguments. Be specific, very specific on all the work deliverables of your work scope. Another useful thing to do is to explain every term and phrase used throughout the scope document in detail as an appendix in the document.


Learning the hard way I soon realized that you need to cover yourself all the time. An informal or verbal agreement is not good enough therefore record every single agreement on email and make sure you bring it to all of the project stakeholder’s attention. Unfortunately it seems that the client either tends to forget what was originally agreed upon or you get the occasional client trying their luck. You must be thinking that surely there is some sort of Scope Document that outlines the deliverables etc. Sure, but sometimes your client’s understanding of a specific term (technical or just plain English) can be very different from yours. This is exactly the kind of scenarios I’m referring to, where a specific term or phrase can be manipulated and abused to make something which is out of scope appear like it is part of your scope of work.

Tags:
Posted in Freelancing | 1 Comment »

0

The new design of dotneto.com

Finally, I managed to finish up the design of this site.


Please be patient with the content submission as I’m still in the process of migrating from my old blog site that can be found here.


I’m hoping to have everything completed by the end of this week.


Watch out for new and exciting content and a couple of videos within the first few weeks after the official launch of dotneto.com

Tags:
Posted in Uncategorized | No Comments »

-->