Thoughts on .Net & Coding
.Net Articles, tutorials, reviews, code and more...
-
7 Things You Need To Know About Web Workers
Web Workers allow you to run JavaScript code in the background without blocking the web page user interface. Web workers can improve the overall performance of a web page and also enhance the user experience. Web workers come in two flavors - dedicated web workers and shared web workers. This article discusses seven key aspects of web workers that you need to know if you decide to use them in your applications.
-
Posting GridView Data to MVC Controller
Visual Studio 2013 provides a unified development environment for ASP.NET Web Forms and ASP.NET MVC applications. This unified environment is called as One ASP.NET. What it means for developers is that a single project can use Web Forms, MVC controllers and Web API. Under One ASP.NET at times the existing Web Forms may want to send and receive data to and from the MVC controllers. This article illustrates how this task can be accomplished.
-
7 Things You Should Know About the Geolocation API
Many websites don't need to know anything about the geographical location of their visitors. In certain cases, however, this knowledge can be useful and can be used to enhance the user experience. This knowledge can also be used to integrate special features into your application. Consider, for example, a company selling some electrical equipment. By knowing the user's geographical location you can suggest the nearest store where they can visit, and purchase the products. To provide such suggestions it is important to capture the user's location. To that end, the Geolocation API allows you to do just that. This article examines seven key things you should know about the Geolocation API in order to use it in your web applications.
-
Using Complex Types in Entity Framework
A database table represents your application data in row-column format. Although in many cases this row-column structure can be mapped directly to entities, at times you may need to reorganize the same. Consider, for example, the Customers table of Northwind database. The Customers table has Address, City, Region, Country and PostalCode columns representing the address of the company. The entity that represents this table might not be as "flat" as the table. For example, you may wish to have a property - Location - that is of class type and has properties such as Street, City, Region and PostalCode. Luckily, entity framework allows you to do so quite easily. The remainder of this article explains how.
-
Understanding the Proper Way to Lay Out a Page with HTML5
A web page being rendered in the browser consists of many things - logo, informative text, pictures, hyperlinks, navigational structure and more. HTML5offers a set of markup elements that allow you to create a structured layout for web pages. These elements are often termed as Semantic Markup because they convey their meaning and purpose clearly to the developer and to the browser. This article discusses some of the important HTML5 elements that can contribute to the layout of a web page.
-
Executing Raw SQL Queries using Entity Framework
While working with Entity Framework developers mostly use LINQ to Entities to query database. However, at times you may need to execute raw queries against the database. A common scenario is when you wish to generate an SQL query dynamically. Luckily, EF allows you to execute raw queries easily. This article explains how that can be done.
-
Posting multiple pieces of data to Web API
Web API allows you to create RESTful services easily. A typical Web API implements GET, POST, PUT and DELETE verbs by writing methods intended to handle each of these HTTP verbs. Although the actual method implementation can be anything as per your application requirement, you need to follow certain method signatures. For example, the Post() method signature accepts the data accompanying the request as a single parameter.
-
5 HTML5 Features Every Developer Should Know How to Use
As HTML5 becomes more and more common, it is important for web developers to know the main features and how to use them. HTML5 not only includes new markup elements but also APIs that can be consumed from the JavaScript code. If you are not familiar with HTML5 yet, it's the right time to peek into some of the interesting features. To that end this article discusses some of the features of HTML5 that are worth knowing. Specifically you will learn about audio, video and canvas elements, new input types, miscellaneous form features and custom data attributes.
-
My latest book - Beginning jQuery 2 for ASP.NET Developers
Beginning jQuery 2 for ASP.NET Developers - Written specifically for ASP.NET Developers, this book covers all the essential information about using jQuery with ASP.NET Web Forms and ASP.NET MVC applications. Covers Selectors, Event Handling, DOM Manipulation, Ajax, Effects and Animations, Plugin development, introduction to jQuery Mobile and jQuery UI and more. For details visit:
-
Dealing With Optimistic Concurrency in Entity Framework
When you update a database record with the entity values, the database values are overwritten by the entity values (default behavior). In a real world situation it is quite possible that database values might have got changed after selecting them for modification. In such cases, your update operation might be overwriting changes made by someone else. That is why it becomes important to detect if concurrency violation has occurred. You can then take some corrective action or at least inform the user about such a violation. To that end this article shows how to detect concurrency violation in EF and also the possible ways to deal with the situation.