Skip to main content


Showing posts from June, 2013

JQuery: How to get the current Page URL in JQuery/JavaScript?

Every now and then we need current page URL, it’s very easy to get current page URL at server side(C#), but people found it’s tricky while we need to get current page URL on client side, but it’s not so tricky.
We can get current page URL with both jQuery and JavaScript as:
$(document).ready(function () { //with jquery location object var path = $(location).attr('href');
//with javascript code var path = window.location.href; });
In jQuery we can use “location” object to get the more details of current page like host, hash, protocol, pathname, etc.
Same way we can use “window.location” in JavaScript to get all details of current page URL.
Let’s understand this with one example URL:
JQuery JavaScript Result $(location).attr('href'); window.location.href :8080/test.aspx#tab $(location).attr('host'); $(location).attr('hostname'); window.location.hostname

Difference between Entity Framework 3.5 and Entity Framework 4.0 (What's New in Entity Framework 4.0?)

The first release of Entity Framework shipped in .NET Framework 3.5 SP1 and Visual Studio 2008. Entity Framework 4 has been released as part of the release of Visual Studio 2010 and .NET Framework 4.0.
Entity Framework 4.0 builds on Entity Framework 3.5 in the following areas:
Multi-Targeting Support: Entity Data Model Designer and Entity Framework fully support Multi-Targeting capabilities of VS 2010. You can use the designer to continue building your EF 3.5 applications or move forward to EF4. We take care of upgrading / downgrading you to the right EDMX versions and such so that you can use a single IDE to build apps using EF, regardless of the framework version you are targeting.
Model-First Development: In addition to the Database-First approach you had in EF 3.5, Entity Data Model designer in Visual Studio 2010 includes Model-First capability to allow you to start from a model, and generate database based on that model.
Code-Only Development: Write classes and have EF infer a concep…