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 :-)
The main idea behind this article is to insert data using jQuery AJAX to avoid postback. AJAX offers users a seamless way to work with your interface, no waiting for whole pages to load. jQuery has a set of tools to make it super simple to implement. Most everyone knows what iAJAX is. But for the beginners i would like to provide some information regarding the AJAX. W hat is AJAX? AJAX is a short hand for asynchronous JavaScript and XML. Which plainly means that instead of waiting for the whole page to load, you can load only what you need to. So if you only need to update one small text part of your site, you don’t have to worry about loading everything else on that page. A vast majority of sites use this technology now. Probably one of the most popular uses is an auto complete feature for the search box at Google and Yahoo. If you see another term XHR, which is shorthand for XML HTTP request, it’s the same thing. Do...
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...
Comments
Post a Comment