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 :-)
We may face a scenario to export the data of custom class object to excel using InterOp .You can get the property name's from the class object using Reflection.Create a work sheet header by reading the each propety of the class object.I have created a separate method to get the all properties into a list collection of string as given below /// /// Get the list of Properties Name into a list collection. /// /// /// public List GetPropeties(Employee objEmployee) { Type myType = objEmployee.GetType(); IList props = new List (myType.GetProperties()); ...
Comments
Post a Comment