Posts

Showing posts from 2017

Difference between array, arraylist, List, Hashtable, Dictionary and SortedList in c#

Basic difference is that arrays are of fixed size. Whereas an ArrayList implements the list data structure and can dynamically grow. While arrays would be more performance that a list, a list would be far more flexible since you don't need to know the required size initially. Array - represents an old-school memory array - kind of like a alias for a normal type[] array. Can enumerate. Can't grow automatically. I would assume very fast insertion, retrieve and speed. ArrayList - automatically growing array. Adds more overhead. Can enum., probably slower than a normal array but still pretty fast. These are used a lot in .NET List - one of my favorites - can be used with generics, so you can have a strongly typed array, e.g. List . Other than that, acts very much like ArrayList. Hashtable - plain old hashtable. O(1) to O(n) worst case. Can enumerate the value and keys properties, and do key/val pairs. Dictionary - same as above only strongly typed via generics, such a...

ASP.NET 4.0 potentially dangerous Request.Form value was detected issue resolved

To resolve the issue of request validation, I added the following to the existing "page" directive in that .aspx file. ValidateRequest="false" But I still got the same error. Later I found that, for .NET 4, we need to add requestValidationMode="2.0" to the httpRuntime configuration section of the web.config file like the following: <httpRuntime requestValidationMode="2.0"/> But if there is no httpRuntime section in the web.config file, then this goes inside the <system.web> section. If anyone wants to turn off request validation globally for a user, the following line in the web.config file within <system.web> section will help: <pages validateRequest="false" />  Note: But always avoid the last example because there is a huge security issue. The request validation feature in ASP.NET provides a certain level of default protection against cross-site scripting (XSS) attacks. However, we recommend that you analyze an...

All about Angular UI Bootstrap framework

Angular UI Bootstrap AngularUI Bootstrap, as name says, is built on top one of the most popular front-end frameworks, Bootstrap. The goal is to provide native AngularJS directives without any dependency on jQuery or Bootstrap's JavaScript. It is often better to rewrite an existing JavaScript code and create a new, pure AngularJS directive. Most of the time the resulting directive is smaller as compared to the original JavaScript code size and better integrated into the AngularJS ecosystem. Installation Installation is easy as UI Bootstrap has minimal dependencies - only the AngularJS and Twitter Bootstrap's CSS are required. Notes: •Sincer version 0.13.0, UI Bootstrap depends on ngAnimate for transitions and animations, such as the accordion, carousel, etc. Include  ngAnimate  in the module dependencies for your app in order to enable animation. •UI Bootstrap depends on ngTouch for swipe actions. Include  ngTouch  in the module dependencies for your app in order to e...

Mobile Angular UI framework

Mobile Angular UI is a mobile UI framework just like Sencha Touch or jQuery Mobile. Mobile Angular UI provides essential mobile components that are missing in Bootstrap 3: switches, overlays, sidebars, scrollable areas, absolute positioned top and bottom navbars that don't bounce on scroll.It relies on robust libraries like fastclick.js and overthrow.js to achieve the better mobile experience. Mobile Angular UI retains most of the Bootstrap 3 syntax. This way it's trivial to bring an existing desktop web app to mobile. Also a super-small css file is provided to do the opposite. Just include it and you'll get a fully responsive and touch enabled interface that can be used everywhere. Awesome Mobile Components Mobile Angular UI provides essential mobile components that are missing in Bootstrap 3: switches, overlays, sidebars, scrollable areas, absolute positioned top and bottom navbars that don't bounce on scroll. It relies on robust libraries like fastclick.js and overth...

All about AngularJs framework

Image
"AngularJS is a JavaScript framework which simplifies binding JavaScript objects with HTML UI elements." Let us try to understand the above definition with simple sample code. Below is a simple "Customer" function with "CustomerName" property. We have also created an object called as "Cust" which is of "Customer" class type. function Customer() { this.CustomerName = "AngularInterview"; } var Cust = new Customer(); Now let us say the above customer object we want to bind to a HTML text box called as "TxtCustomerName". In other words when we change something in the HTML text box the customer object should get updated and when something is changed internally in the customer object the UI should get updated. <input type=text id="TxtCustomerName" onchange="UitoObject()"/> So in order to achieve this communication between UI to object developers end up writing functions as shown below. "UitoO...

All about interface in c#.net

An interface contains definitions for a group of related functionalities that a class or a struct can implement. You can define an interface by using the interface keyword, as the following example shows. interface IEquatable < T > { bool Equals ( T obj ) ; } To implement an interface member, the corresponding member of the implementing class must be public,  non-static, and have the same name and signature as the interface member. Quick overview of interface : An interface is like an abstract base class. Any class or struct that implements the interface must implement all its members. An interface can't be instantiated directly. Its members are implemented by any class or struct that implements the interface. Interfaces can contain events, indexers, methods, and properties. Interfaces contain no implementation of methods. A class or struct can implement multiple interfaces. A class can inherit a base class and also implement one or more int...