We normally face a task like to show Menu when we right click the gridview or treeview e.t.c. Many third party controls are providing this right click context Menu to the controls like one of the best third party control like Telerik . But we can do this type of requirements using jQuery also. To do this in ASP.NET we need to download the jQuery Context Menu plugin. We need frame the menu div based on our requirement.See this example to do < div > < ul id ="myMenu" class ="contextMenu" > < li class ="edit" >< a href ="#edit" > Edit Node </ a > </ li > < li class ="delete" >< a href ="#delete" > Delete Node </ a > </ li > </ ul > </ div > * This source code was highlighted with Source Code Highlighter . After downloading the plugin you need to add this l...
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 :-)
Memory management is very important in any application development.The Garbage collector of .NET does almost all clean up activity for your objects.For unmanaged resources (Ex:Windows API created objects, File, Database connection objects, COM objects, etc.) are outside the scope of .NET framework. Why Dispose() is preferred than Finalize() If we use the " Finalize() " method,the Garbage collector has to make two round in order to remove the objects. For an instance ,let me explain clearly if we have two objects as Object1 and Object2 and we finalize the Object2 as given in the below image.The GC has to categorize the two objects and put the Finalize objects into Finalization Queue.The GC will clean the object1 which doesn't use the Finalize() method and process the second round of cleaning the Finalization Queue. Now at this the " Dispose() " method will come into picture.This method belongs to IDisposable() interface .So the best practise to...
Comments
Post a Comment