Best / Top Websites that use ASP.NET MVC

MVC is a framework methodology that divides an application’s implementation into three component roles: models, views, and controllers.

ASP.NET MVC is now being considered as one of the best options when creating a big website, below is a small compilation  of  some really good sites that are using ASP.NET MVC.

Below is a small compilation of some of the very good sites using ASP.NET MVC

1. StackOverflow.com

2. Codeplex.com

3. WorkGrabber.com

4. MarketWatch.com

5. ArtistIntersect.com

6. DimeCasts.net

How to add horizontal scroll or vertical scroll to a div

Using the overflow CSS property this can be achieved !

The overflow property specifies what happens if content overflows an element’s box.

If the content of the div is too tall, there will be a vertical scrollbar. If the content is too wide there will be a horizontal scrollbar.

Code


<div style="overflow:auto;width:300px;height:250px;">

India, officially the Republic of India is a country in South Asia. It is the seventh-largest country by geographical area, the second-most populous country with over 1.2 billion people, and the most populous democracy in the world. Bounded by the Indian Ocean on the south, the Arabian Sea on the south-west, and the Bay of Bengal on the south-east, it shares land borders with Pakistan to the west; China, Nepal, and Bhutan to the north-east; and Burma and Bangladesh to the east. In the Indian Ocean, India is in the vicinity of Sri Lanka and the Maldives; in addition, India's Andaman and Nicobar Islands share a maritime border with Thailand and Indonesia. 

</div>

Demo / Output

India, officially the Republic of India is a country in South Asia. It is the seventh-largest country by geographical area, the second-most populous country with over 1.2 billion people, and the most populous democracy in the world. Bounded by the Indian Ocean on the south, the Arabian Sea on the south-west, and the Bay of Bengal on the south-east, it shares land borders with Pakistan to the west; China, Nepal, and Bhutan to the north-east; and Burma and Bangladesh to the east. In the Indian Ocean, India is in the vicinity of Sri Lanka and the Maldives; in addition, India’s Andaman and Nicobar Islands share a maritime border with Thailand and Indonesia. In the Indian Ocean, India is in the vicinity of Sri Lanka and the Maldives; in addition, India’s Andaman and Nicobar Islands share a maritime border with Thailand and Indonesia.In the Indian Ocean, India is in the vicinity of Sri Lanka and the Maldives; in addition, India’s Andaman and Nicobar Islands share a maritime border with Thailand and Indonesia. In the Indian Ocean, India is in the vicinity of Sri Lanka and the Maldives; in addition, India’s Andaman and Nicobar Islands share a maritime border with Thailand and Indonesia.In the Indian Ocean, India is in the vicinity of Sri Lanka and the Maldives; in addition, India’s Andaman and Nicobar Islands share a maritime border with Thailand and Indonesia.

More – overflow-x and overflow-y

Follow these links for more information, overflow-x and overflow-y.

How to remove babylon search from firefox or other browsers ?

I don’t remember how I got this “Babylon search” thing installed on my Firefox.

Now everytime I open my Firefox, I am being greeted by a babylon search homepage instead of my default Google’s Homepage and also the google’s search bar (next to the address bar) got replaced with babylon search bar.

Now how did I remove it ?????

So, here is a small step by step guide on how to remove babylon search from firefox…..

Step 1 : Use Add/Remove Programs, using the search filter ‘babylon’ uninstall these two.

Step 2 : Goto Options and change the home page url from whatever it was to say “google.com” and click ok.

Step 3 : Restart your Firefox, now you will not see the babylon search page, instead it will show you the page which you have set as Homepage, which is google.com in my case.

But still the search the web option, see the circle on the image below, still shows babylon and on search redirects to babylon.com, read on and you will know how to remove that too…

Step 4 : To revert to Google as your preferred search engine, please do the following.

In the location bar, type about:config and hit Enter. In the filter at the top, type: keyword.URL

Double click it and remove whatever’s in there and replace it with http://www.google.com/search?q=

It’s possible that Babylon will add itself to more than one place in about:config. Therefore, after completing the above steps, type “babylon” in the filter at the top. For every instance where you see a setting with that name in it, right click it and choose Modify and then Reset. Then close Firefox and restart it.

Thats it … and you are done… see the screenshot below with the google search :)

How do I add ASP.NET MVC 3 Web Application in Visual Studio 2010

ASP.NET MVC 3 Web Application Template not found in Visual Studio 2010 ?

With Visual Studio 2010 installed, I wanted to create an MVC 3 Web Application, but after heading to the ‘Add New Project’ dialog box, I was surprised to not find a MVC 3 Web Application template.

How go I get MVC 3 templates ?

OK, first you need to head to this link and install ASP.NET MVC 3 framework (approx 21 MB). After you are done with the installation, restart you visual studio 2010.

Now when you create a new project, make sure you have selected .NET Framework 4 in the drop down for framework. You should be able to see both ASP.NET MVC 2 Web Application and ASP.NET MVC 3 Web Application.

And now you are good to go….

UEFA Champions League Final 2012 India Timings : Chelsea vs Bayern Munich

The match starts at 12:15 midnight in India on Tens Sports.

The 2012 UEFA Champions League Final will be a football match between English club Chelsea and Bayern Munich of Germany.

The match will be played on 19 May 2012 (kick off at 20:45 local time, 18:45 GMT, Indian Time : 12:15 midnight) at the Allianz Arena in Munich, Germany.

The match will decide the winner of the 2011–12 season of the UEFA Champions League, Europe’s premier club tournament organised annually by the UEFA confederation.

The winners receive the European Champion Clubs’ Cup (the European Cup). The game is the culmination of the 57th season of the tournament, and the 20th since it was renamed the Champions League.

What is Entity Framework ? What are POCO entities ?

What is Entity Framework?

Entity Framework is Microsoft’s recommended data access technology for new applications.

The Microsoft ADO.NET Entity Framework is an Object/Relational Mapping (ORM) framework that enables .NET developers to work with relational data using domain-specific objects. It eliminates the need for most of the data-access code that developers usually need to write.

Using the Entity Framework, developers issue queries using LINQ, then retrieve and manipulate data as strongly typed objects.

The Entity Framework’s ORM implementation provides services like change tracking, identity resolution, lazy loading, and query translation so that developers can focus on their application-specific business logic rather than the data access fundamentals.
EF maps to the database tables using a model. This model is responsible for mapping the application’s entities and their relationships to the data held in the physical database. It’s a combination of three layers, and is stored as an Entity Data Model (.edmx) file. .edmxis an XML based file that consists of these 3 layers.

Storage Layer: this is defined with Store Schema Definition Language (SSDL). Table structures and their relationships are defined here.

Conceptual Layer: this is defined with Conceptual Schema Definition Language (CSDL). Business entities and their relationships are described in the conceptual schema.

Mapping Layer : This is defined with Mapping Specification Language (MSL). It maps the conceptual schema to the storage schema. The mapping schema describes how the business entities map to the database schema, and how database tables map to the entities in the model.

What are the different versions of Entity Framework?

The first version of Entity Framework (EFv1) was included with .NET Framework 3.5 Service Pack 1 and Visual Studio 2008 Service Pack 1, released on 11 August 2008. This version has been widely criticized, even attracting a ‘vote of no confidence’ signed by approximately one thousand developers.

The second version of Entity Framework, named Entity Framework 4.0 (EFv4), was released as part of .NET 4.0 on 12 April 2010 and has addressed many of the criticisms made of version 1.

A third version of Entity Framework, version 4.1, was released on April 12, 2011, with Code First support.

A refresh of version 4.1 named Entity Framework 4.1 Update 1, was released on July 25, 2011. It includes bug fixes and new supported types.

The latest version is 4.3.1, which was released on February 29, 2012. There are a few updates, like support for migration.

Features of Entity Framework

Provides integrated Visual Studio tools to visually create entity models and to auto-generate models from an existing database. New databases can be deployed from a model, which can also be hand-edited for full control.

Provides a Code First experience to create entity models using code. Code First can map to an existing database or generate a database from the model.

Integrates well into all the .NET application programming models including ASP.NET, Windows Presentation Foundation (WPF), Windows Communication Foundation (WCF), and WCF Data Services (formerly ADO.NET Data Services)

Works with a variety of database servers (including Microsoft SQL Server, Oracle, and DB2)

Benefits / Advantages of using Entity Framework 

Reduced development time: the framework provides the core data access capabilities so developers can concentrate on application logic.

Developers can work in terms of a more application-centric object model, including types with inheritance, complex members, and relationships. In .NET Framework 4, the Entity Framework also supports Persistence Ignorance through Plain Old CLR Objects (POCO) entities.

Applications are freed from hard-coded dependencies on a particular data engine or storage schema by supporting a conceptual model that is independent of the physical/storage model.

Mappings between the object model and the storage-specific schema can change without changing the application code.

Language-Integrated Query support (called LINQ to Entities) provides IntelliSense and compile-time syntax validation for writing queries against a conceptual model.

Developer Workflows – (Code First/Model First/Database First)

Entity Framework has three developer workflows to help you access data in your application:

Code First – As the name suggests this approach is all about code. You write the classes that make up your domain model. A set of conventions map these classes to a database schema but you can provide additional mapping using code. Code First can map to an existing database or generate a database schema for you based on your model and mapping. If you are targeting an existing database the EF Power Tools can help you get started by generating basic classes and mapping for you.

Model First – You build your model using ‘boxes and lines’ in the Entity Model Designer. Once you model is created the designer will generate a database schema for your model. The classes that make up your domain model are generated for you.

Database First – If you have an existing database this approach allows you to reverse engineer a ‘boxes and lines’ model in the designer. You can then tweak the shape of the model and how it maps to your existing database schema. The classes that make up your domain model are generated for you.

What are Poco Entities ?
POCO stands for Plain Old CLR Object and refers to an object that does not have any persistence concerns and is not aware of persistence framework. Modern development approaches such as DDD (Domain-Driven Design) and TDD (Test-Driven Development) prefer clear separation of concerns which implies persistence ignorance.
The POCO Template can be used to generate persistence ignorant entity types from an Entity Data Model.

What do you mean by Ninject ?
Ninject is a lightweight dependency injection framework for .NET applications. It helps you split your application into a collection of loosely-coupled, highly-cohesive pieces, and then glue them back together in a flexible manner. By using Ninject to support your software’s architecture, your code will become easier to write, reuse, test, and modify.

Related Video

How to change username and password of your Cpanel account ?

There may be times where you would like to change your Cpanel username or password. But how do you do it ? This tutorial will be discussing this…

Can I change my Cpanel Username ?

Here you will get mixed answers, most hosting providers will not allow you to change username, because cPanel accounts are tied to the username, your home directory, configurations, email, etc. However few hosting providers do provide this feature but for that too you need to submit a ticket or something.

Can I change my Cpanel Password ?

Yes, you can do that :) let me show you how…

Step 1 : First login to your Cpanel account using your existing username and password.

Step 2 : On your homescreen, on the top right hand side, under the ‘Preference’ Tab select the ‘Change Password‘ option.

Step 3 : Provide your old Password and punch in a strong new password and submit.

Step 4 : Once done, you should get a window with the following message.

That’s it you have successfully changed your cPanel password !

Check if a File exists using C#

If you want to check if a specific file exists on a local machine at a particular path using C# programming language, you can do so by using the File.Exists() method.

To use this first you need to import the System.IO namespace.

using System.IO;

Next, below is a sample code that checks if a file exists, first in the same directory and then in some different directory, in case of any doubts/suggestion feel free to use the comments section. Cheers !

using System;  
using System.IO;

class Program  
{  
    static void Main()  
    {

        // See if this file exists in the SAME DIRECTORY.  
        if (File.Exists("Yasser.txt"))  
        {  
            Console.WriteLine("The file exists.");  
        }  

        // See if this file exists in the C:\YS\ directory.  
        if (File.Exists(@"C:\YS\Yasser.txt"))  
        {  
            Console.WriteLine("The file exists.");  
        }

    }  
}  

You can find the documentation here on MSDN.

What is Kies Air for Android ? How to Install and Use it ?

What is Kies Air ?

Kies air is a mobile application which enables Wi-Fi mobile-to-device connections and browser-based management. You can use Kies air without PC software or a USB connection.

How to Install Kies Air ?

Kies Air can be installed from the Android Market (now called Google Play) here is a link to it.

How to Use Kies Air ?

Here is a very nice guide to it by samsung : Link

How does it look ? Is it good ?

Well I have been using it for a while now, and I am finding it simply awesome ! Below is how my home screen looks like…

So if you are a Samsung Android Phone User what are waiting for ? Grab this free app now !

Check Box in Webgrid MVC 3

Below is a simple demonstration on how to use checkbox inside a  webgrid column in MVC 3.

I had a field called ‘HasPassport‘ in my model which was of type **boolean **for which I required a checkbox column, to show a checked checkbox for every true value and an unchecked checkbox otherwise.

Using the WebGrid.Column’s format parameter below is how I have used…

grid.Column(  
header: "HasPassport ?",  
format:  
(col) => @Html.Raw(

"<input type='checkbox' checked='" +

((col.HasPassport) ? "checked" : "") +

"' disabled='true' />")  
)  

So for every true value for the ‘hasPassport’ field the following HTML code is generated :

<input type='checkbox' checked='checked' disabled='true' />  

Hope this helps ! Cheers !