Thursday, May 24, 2012

Differences between asp.net 1.1 and asp.net 2.0

Asp.net 2.0 many new features like

* Partial Classes
Master pages
* Skins and Themes
* Roles and MemberProfiles
* Generics
* Added many new server contols like GridView,DetilsView,FileUpload etc..,
* Web Personalization - Web Parts
* New Folders lime App_Browsers,App_Code,etc..,

Monday, May 21, 2012

View State and Cookies


viewstate 
The ViewState property provides a dictionary object for retaining values between multiple requests for the same page. This is the default method that the page uses to preserve page and control property values between round trips.
When the page is processed, the current state of the page and controls is hashed into a string and saved in the page as a hidden field, or multiple hidden fields if the amount of data stored in the ViewState property exceeds the specified value in the MaxPageStateFieldLength property. When the page is posted back to the server, the page parses the view-state string at page initialization and restores property information in the page.
You can store values in view state as well. For more information on using View State, see ASP.NET View State Overview. For recommendations about when you should use view state, seeASP.NET State Management Recommendations.

Cookies

<div class="subsection" xmlns="http://www.w3.org/1999/xhtml">
A cookie is a small amount of data that is stored either in a text file on the client file system or in-memory in the client browser session. It contains site-specific information that the server sends to the client along with page output. Cookies can be temporary (with specific expiration times and dates) or persistent.
You can use cookies to store information about a particular client, session, or application. The cookies are saved on the client device, and when the browser requests a page, the client sends the information in the cookie along with the request information. The server can read the cookie and extract its value. A typical use is to store a token (perhaps encrypted) indicating that the user has already been authenticated in your application.
For more information about using cookies, see Cookies and ASP.NET State Management Recommendations.
What is are the difference between them?
Some good discussion about the difference between Session and Viewstate : Session Vs ViewState

Why we to go for MVC


There are various positive points to moving towards MVC

1.  TDD support out of the box as most of the design is based on interfaces.
2.  SEO friendly URL by design (though now this is possible in ASP.NET 4 as well)
3.  No ViewState (this may seem a bit of moving backward to some), but overall a good design decision.
4.  Clean View Markup (no additional HTML emitted)
5.  100% extensible.  You can add your own controller with IOC, switch view engines at will, control model binding at wish etc.
6.   Rich UI support (possible through client side JS libraries like jQuery UI and others).  Telerik has released some controls for MVC which includes Grid control as well (which are merely HTMLHelpers)
7.  Session, JS, Ajax works.  Validation is even more powerful with DataAnnotations and jquery.
8.  Is MVC faster?  Yes by default because of lack of viewstate and clean markup.  But performance is subject and MVC by design is more performant that traditional ASP.NET webforms (though webforms can be made as fast as required.
9.  Out of the box support for mitigating antiforgery attacks and XSS vulnerability (though asp.net does has this to some extent)
10.  Out of the box minimal IOC support.
11.  Full control over rendered HTML
12.  Pluggable architecture
13.   And much more....

Couple of limitations (though not exactly)
1.  Learning curve as most asp.net developers are used to windows form model for web development.


NOTE:  Webforms is not bad.  But by design it encourages many bad practices.  A webform at the hands of careful developer is as or could be even more productive than MVC.  Just my thought.

Additional readings at http://msdn.microsoft.com/en-us/magazine/dd942833.aspx
Thanks...

Authentication & authorization

Thursday, May 17, 2012

Moving Items from One ListBox to other ListBox using JQuery


Following script will move the selected items from one list box item to another list box item.

Markup:
<asp:ListBox ID="lstBox1" runat="server" SelectionMode="Multiple">
            <asp:ListItem Text="A" Value="1"></asp:ListItem>
            <asp:ListItem Text="B" Value="2"></asp:ListItem>
            <asp:ListItem Text="C" Value="3"></asp:ListItem>
            <asp:ListItem Text="D" Value="4"></asp:ListItem>
</asp:ListBox>
<asp:Button ID="btnMoveRight" runat="server" Text=">>" />
<asp:Button ID="btnMoveLeft" runat="server" Text="<<" />
<asp:ListBox ID="lstBox2" runat="server" SelectionMode="Multiple">
            <asp:ListItem Text="E" Value="5"></asp:ListItem>
            <asp:ListItem Text="F" Value="6"></asp:ListItem>
            <asp:ListItem Text="G" Value="7"></asp:ListItem>
            <asp:ListItem Text="H" Value="8"></asp:ListItem>
</asp:ListBox>
JQuery script:
$(document).ready(function() {
            $('#<%=btnMoveRight.ClientID %>').click(function() {
                var selectedOptions = $('#<%=lstBox1.ClientID %> option:selected');
                if (selectedOptions.length == 0) {
                    alert("Please select option to move");
                    return false;
                }
                $('#<%=lstBox2.ClientID %>').append($(selectedOptions).clone());
                $(selectedOptions).remove();
                return false;
            });
            $('#<%=btnMoveLeft.ClientID %>').click(function() {
                var selectedOptions = $('#<%=lstBox2.ClientID %> option:selected');
                if (selectedOptions.length == 0) {
                    alert("Please select option to move");
                    return false;
                }
                $('#<%=lstBox1.ClientID %>').append($(selectedOptions).clone());
                $(selectedOptions).remove();
                return false;
            });
});

ASP.NET Open Source Projects


Links to ASP.NET Open Source Projects
Blogs
  • Blogsa.net - A blog engine in Asp.net.
  • dasBlog
  • BlogEngine.NET - Very functional, simple and clean Blog engine in ASP .Net 3.5.
  • SubText - A blogging engine in ASP.NET.
  • Owlpal - Web Content System.
  • AtomSite (formerly BlogSvc) - Built using ASP.NET MVC.
  • Oxite - Built using ASP.NET MVC.
Content Management Systems
e-Commerce
Controls/Toolkits/Frameworks 

Forums
Galleries
Starter Kits
Wikis 
Miscellaneous
Additional Projects

refer from wiki article

Mobile Applications

 ASP.NET 2.0 enables you to easily create applications targeting such devices.
The following links give you a head start on mobile application development with ASP.NET:
Since most developers will not actually use cellular devices to test their mobile applications, device emulators have been created by companies like Microsoft, Nokia and others for testing purposes. A device emulator is software that simulates a mobile device. The Visual Studio IDE includes built-in emulator SDKs for Pocket PC and SmartPhone.
Working with Device Emulators:
Podcasts:
Mobile-enabled Web Forms, MVC application samples

Wednesday, May 9, 2012

Linq to sql or Entity Framework


Entity Framework:
1. Enterprise Development
2. Works with Conceptual model of database
3. Works with all data sources
4. ".EDMX" is created while using Entity Framework

LINQ:
1. Rapid Application Development
2. Works with objects in database
3. Mainly woks with SQL Server
4. ".dbml" is created while using LINQ to SQL

Entity Framework is more targeted towards Enterprise Development where the schema is usually optimized for storage considerations like performance consistency and partitioning. Entity Framework is designed around exposing an application-oriented data model that is loosely coupled and may differ from the existing database schema. For example, you can map a single entity (class) to multiple or map multiple entities to the same table. Entity Framework has “.edmx” (ADO.NET Entity Model) file when added in the application.

LINQ to SQL mainly has features to support Rapid Application Development against SQL Server. LINQ to SQL allows you to have a strongly typed view of your existing database schema. You can build LINQ queries over tables and return results as strong typed objects. LINQ to SQL has “.dbml”(LINQ to SQL) file when added in the application. You can use LINQ to SQL by decorating the existing classes with the attributes.

Please review: Entity Framework Basics

Tuesday, May 8, 2012

.Net Framework Versions


Version
Version Number
Release Date
Visual Studio Framework
 Operating System
1.0
1.0.3705.0
13-02-2002
Visual Studio .NET
Windows Server 2003
1.1
1.1.4322.573
24-04-2003
Visual Studio .NET 2003
Windows Server 2003
2.0
2.0.50727.42
07-11-2005
Visual Studio 2005
Windows Server 2003 R2
3.0
3.0.4506.30
06-11-2006
Visual Studio 2005
Windows Vista, Windows Server 2008
3.5
3.5.21022.8
19-11-2007
Visual Studio 2008
Windows 7, Windows Server 2008 R2
4.0
4.0.30319.1
12-04-2010
Visual Studio 2010
Windows 7, Windows Server 2008 R2



















Now we can read about all the new functionality that we are making available as pat of ASP.NET 4.5 and Visual Studio 11 Developer Preview at the following page: http://www.asp.net/vnext/whats-new.
Thanks...

how to increase SEO(search engine optimization)