Posts

Showing posts with the label Javascript

How to fix "Sys is undefined" error ?

Image
Recently I have faced a strange issue in the process of developing a task using script manager for async post backs. The error is " webresource.axd and scriptresource.axd 404 not found " whenever I do any async call I use to get this error " sys is not defined ". I have tried a lot to fix this issue by following the below links. 1. http://blogs.msdn.com/b/carloc/archive/2008/12/04/webresource-axd-or-scriptresource-axd-not-working.aspx 2. http://imnettellect.blogspot.in/2010/12/iis-75-webresourceaxd-and.html 3. http://stackoverflow.com/questions/1433512/asp-net-web-application-webresource-axd-and-scriptresource-axd-files-loading and so on .... After spending 4 hours I found a new property on asp.net 4.0 called EnableCdn that basically, if it's set to "true", it loads the resources from the Microsoft content resource servers. Refer this link for information about EnableCDN . This worked like a charm and fixed my issue. I hope this snippet can help...

Detailed Table using jQuery

Image
We have seen in many sites regarding detailed information of products below the row when we click on the downwards arrow and collapse when click on upwards arrow. We have many plugin's for this type of functionality we can also do with jQuery simple logic also. I have done some R&D regarding this and want to share information of detailed table using jQuery. We need to download the latest jQuery File from this link http://jquery.com/download/ We have many CDN links also available for directly accessing the jQuery library files. Google : https://developers.google.com/speed/libraries/devguide#jquery Micro-soft : http://www.asp.net/ajaxlibrary/cdn.ashx Git-hub: https://github.com/jquery/jquery

Restrict the Textbox to enter only Numbers Using Javascript

Normally we get this type of requirement to accept only numbers in a text box.Suppose we have a Credit Card Number entry where we want to validate the key-press is number or not.Here i have simplified the way to enter only numbers in the text-box. Here i have written some logic to enter only numbers in textbox using javascript. < script type = " text/javascript " > function isNumberKey ( evt ) { var charCode = ( evt . which ) ? evt . which : event . keyCode if ( charCode > 31 && ( charCode < 48 || charCode > 57 ) ) return false ; return true ; } < script > Now we can call this fu nction in the events like keypress,keydown and keyup to validate the value is number or not. Happy Coding :-)