Click here to Skip to main content
Click here to Skip to main content
Articles » Web Development » ASP.NET » General » Downloads
 
Add your own
alternative version

Fast Postback and Model Binding

, 27 Apr 2014 CPOL
Faster way to save data on postback and simplified model binding with asp.net controls
FastPostback-noexe.zip
FastPostback
FastPostback.v11.suo
FastPostback
App_Start
bin
Content
images
ajax-loader.gif
icons-18-black.png
icons-18-white.png
icons-36-black.png
icons-36-white.png
themes
base
images
ui-bg_flat_0_aaaaaa_40x100.png
ui-bg_flat_75_ffffff_40x100.png
ui-bg_glass_55_fbf9ee_1x400.png
ui-bg_glass_65_ffffff_1x400.png
ui-bg_glass_75_dadada_1x400.png
ui-bg_glass_75_e6e6e6_1x400.png
ui-bg_glass_95_fef1ec_1x400.png
ui-bg_highlight-soft_75_cccccc_1x100.png
ui-icons_222222_256x240.png
ui-icons_2e83ff_256x240.png
ui-icons_454545_256x240.png
ui-icons_888888_256x240.png
ui-icons_cd0a0a_256x240.png
minified
images
ui-bg_flat_0_aaaaaa_40x100.png
ui-bg_flat_75_ffffff_40x100.png
ui-bg_glass_55_fbf9ee_1x400.png
ui-bg_glass_65_ffffff_1x400.png
ui-bg_glass_75_dadada_1x400.png
ui-bg_glass_75_e6e6e6_1x400.png
ui-bg_glass_95_fef1ec_1x400.png
ui-bg_highlight-soft_75_cccccc_1x100.png
ui-icons_222222_256x240.png
ui-icons_2e83ff_256x240.png
ui-icons_454545_256x240.png
ui-icons_888888_256x240.png
ui-icons_cd0a0a_256x240.png
Employee
FastPostback.csproj.user
favicon.ico
Global.asax
Images
accent.png
bullet.png
heroAccent.png
orderedList0.png
orderedList1.png
orderedList2.png
orderedList3.png
orderedList4.png
Models
CompanyModel.edmx
CompanyModel.edmx.diagram
obj
Debug
edmxResourcesToEmbed
Models
CompanyModel.csdl
CompanyModel.msl
CompanyModel.ssdl
Properties
Scripts
WebForms
MSAjax
packages
EntityFramework.5.0.0
Content
App.config.transform
Web.config.transform
EntityFramework.5.0.0.nupkg
lib
net40
net45
tools
EntityFramework.PS3.psd1
EntityFramework.psd1
EntityFramework.psm1
init.ps1
install.ps1
Microsoft.AspNet.FriendlyUrls.1.0.1
Content
App_Start
RouteConfig.cs.pp
Site.Mobile.Master.cs.pp
Site.Mobile.Master.designer.cs.pp
Site.Mobile.Master.pp
ViewSwitcher.ascx.cs.pp
ViewSwitcher.ascx.designer.cs.pp
ViewSwitcher.ascx.pp
Microsoft.AspNet.FriendlyUrls.1.0.1.nupkg
Microsoft.AspNet.FriendlyUrls.Core.1.0.1
lib
net40
net45
Microsoft.AspNet.FriendlyUrls.Core.1.0.1.nupkg
Microsoft.AspNet.Web.Optimization.1.0.0
Microsoft.AspNet.Web.Optimization.1.0.0.nupkg
Microsoft.AspNet.Web.Optimization.WebForms.1.0.0
content
web.config.transform
Microsoft.AspNet.Web.Optimization.WebForms.1.0.0.nupkg
FastPostback.zip
FastPostback.v11.suo
EntityFramework.dll
FastPostback.dll
Microsoft.AspNet.FriendlyUrls.dll
Microsoft.AspNet.Web.Optimization.WebForms.dll
Microsoft.Web.Infrastructure.dll
System.Web.Optimization.dll
ajax-loader.gif
icons-18-black.png
icons-18-white.png
icons-36-black.png
icons-36-white.png
ui-bg_flat_0_aaaaaa_40x100.png
ui-bg_flat_75_ffffff_40x100.png
ui-bg_glass_55_fbf9ee_1x400.png
ui-bg_glass_65_ffffff_1x400.png
ui-bg_glass_75_dadada_1x400.png
ui-bg_glass_75_e6e6e6_1x400.png
ui-bg_glass_95_fef1ec_1x400.png
ui-bg_highlight-soft_75_cccccc_1x100.png
ui-icons_222222_256x240.png
ui-icons_2e83ff_256x240.png
ui-icons_454545_256x240.png
ui-icons_888888_256x240.png
ui-icons_cd0a0a_256x240.png
ui-bg_flat_0_aaaaaa_40x100.png
ui-bg_flat_75_ffffff_40x100.png
ui-bg_glass_55_fbf9ee_1x400.png
ui-bg_glass_65_ffffff_1x400.png
ui-bg_glass_75_dadada_1x400.png
ui-bg_glass_75_e6e6e6_1x400.png
ui-bg_glass_95_fef1ec_1x400.png
ui-bg_highlight-soft_75_cccccc_1x100.png
ui-icons_222222_256x240.png
ui-icons_2e83ff_256x240.png
ui-icons_454545_256x240.png
ui-icons_888888_256x240.png
ui-icons_cd0a0a_256x240.png
FastPostback.csproj.user
favicon.ico
Global.asax
accent.png
bullet.png
heroAccent.png
orderedList0.png
orderedList1.png
orderedList2.png
orderedList3.png
orderedList4.png
CompanyModel.edmx
CompanyModel.edmx.diagram
CompanyModel.csdl
CompanyModel.msl
CompanyModel.ssdl
FastPostback.dll
TempPE
Models.Company.cs.dll
Models.CompanyModel.cs.dll
Models.CompanyModel.Designer.cs.dll
App.config.transform
Web.config.transform
EntityFramework.5.0.0.nupkg
EntityFramework.dll
EntityFramework.dll
EntityFramework.PowerShell.dll
EntityFramework.PowerShell.Utility.dll
EntityFramework.PS3.psd1
EntityFramework.psd1
EntityFramework.psm1
init.ps1
install.ps1
migrate.exe
RouteConfig.cs.pp
Site.Mobile.Master.cs.pp
Site.Mobile.Master.designer.cs.pp
Site.Mobile.Master.pp
ViewSwitcher.ascx.cs.pp
ViewSwitcher.ascx.designer.cs.pp
ViewSwitcher.ascx.pp
Microsoft.AspNet.FriendlyUrls.1.0.1.nupkg
Microsoft.AspNet.FriendlyUrls.dll
Microsoft.AspNet.FriendlyUrls.dll
Microsoft.AspNet.FriendlyUrls.Core.1.0.1.nupkg
lib
net40
System.Web.Optimization.dll
Microsoft.AspNet.Web.Optimization.1.0.0.nupkg
web.config.transform
lib
net45
Microsoft.AspNet.Web.Optimization.WebForms.dll
Microsoft.AspNet.Web.Optimization.WebForms.1.0.0.nupkg
FastPostback_Beta-noexe.zip
FastPostback.v11.suo
FastPostback.v12.suo
App_Data
Company.mdf
Company_log.ldf
ajax-loader.gif
icons-18-black.png
icons-18-white.png
icons-36-black.png
icons-36-white.png
animated-overlay.gif
ui-bg_flat_0_aaaaaa_40x100.png
ui-bg_flat_75_ffffff_40x100.png
ui-bg_glass_55_fbf9ee_1x400.png
ui-bg_glass_65_ffffff_1x400.png
ui-bg_glass_75_dadada_1x400.png
ui-bg_glass_75_e6e6e6_1x400.png
ui-bg_glass_95_fef1ec_1x400.png
ui-bg_highlight-soft_75_cccccc_1x100.png
ui-icons_222222_256x240.png
ui-icons_2e83ff_256x240.png
ui-icons_454545_256x240.png
ui-icons_888888_256x240.png
ui-icons_cd0a0a_256x240.png
animated-overlay.gif
ui-bg_flat_0_aaaaaa_40x100.png
ui-bg_flat_75_ffffff_40x100.png
ui-bg_glass_55_fbf9ee_1x400.png
ui-bg_glass_65_ffffff_1x400.png
ui-bg_glass_75_dadada_1x400.png
ui-bg_glass_75_e6e6e6_1x400.png
ui-bg_glass_95_fef1ec_1x400.png
ui-bg_highlight-soft_75_cccccc_1x100.png
ui-icons_222222_256x240.png
ui-icons_2e83ff_256x240.png
ui-icons_454545_256x240.png
ui-icons_888888_256x240.png
ui-icons_cd0a0a_256x240.png
FastPostback.csproj.user
favicon.ico
Global.asax
accent.png
bullet.png
heroAccent.png
orderedList0.png
orderedList1.png
orderedList2.png
orderedList3.png
orderedList4.png
Company.edmx
Company.edmx.diagram
Company.csdl
Company.msl
Company.ssdl
CompanyModel.csdl
CompanyModel.msl
CompanyModel.ssdl
jquery-2.1.0.min.map
FastPostback_Beta.zip
FastPostback.v11.suo
FastPostback.v12.suo
Company.mdf
Company_log.ldf
AspNet.ScriptManager.jQuery.dll
AspNet.ScriptManager.jQuery.UI.Combined.dll
EntityFramework.dll
EntityFramework.SqlServer.dll
FastPostback.dll
FastPostback.pdb
Microsoft.AspNet.FriendlyUrls.dll
Microsoft.AspNet.Web.Optimization.WebForms.dll
Microsoft.ScriptManager.WebForms.dll
Microsoft.Web.Infrastructure.dll
System.Web.Optimization.dll
System.Web.Providers.dll
ajax-loader.gif
icons-18-black.png
icons-18-white.png
icons-36-black.png
icons-36-white.png
animated-overlay.gif
ui-bg_flat_0_aaaaaa_40x100.png
ui-bg_flat_75_ffffff_40x100.png
ui-bg_glass_55_fbf9ee_1x400.png
ui-bg_glass_65_ffffff_1x400.png
ui-bg_glass_75_dadada_1x400.png
ui-bg_glass_75_e6e6e6_1x400.png
ui-bg_glass_95_fef1ec_1x400.png
ui-bg_highlight-soft_75_cccccc_1x100.png
ui-icons_222222_256x240.png
ui-icons_2e83ff_256x240.png
ui-icons_454545_256x240.png
ui-icons_888888_256x240.png
ui-icons_cd0a0a_256x240.png
animated-overlay.gif
ui-bg_flat_0_aaaaaa_40x100.png
ui-bg_flat_75_ffffff_40x100.png
ui-bg_glass_55_fbf9ee_1x400.png
ui-bg_glass_65_ffffff_1x400.png
ui-bg_glass_75_dadada_1x400.png
ui-bg_glass_75_e6e6e6_1x400.png
ui-bg_glass_95_fef1ec_1x400.png
ui-bg_highlight-soft_75_cccccc_1x100.png
ui-icons_222222_256x240.png
ui-icons_2e83ff_256x240.png
ui-icons_454545_256x240.png
ui-icons_888888_256x240.png
ui-icons_cd0a0a_256x240.png
FastPostback.csproj.user
favicon.ico
Global.asax
accent.png
bullet.png
heroAccent.png
orderedList0.png
orderedList1.png
orderedList2.png
orderedList3.png
orderedList4.png
Company.edmx
Company.edmx.diagram
DesignTimeResolveAssemblyReferencesInput.cache
Company.csdl
Company.msl
Company.ssdl
CompanyModel.csdl
CompanyModel.msl
CompanyModel.ssdl
FastPostback.csprojResolveAssemblyReference.cache
FastPostback.dll
FastPostback.pdb
Models.Company.cs.dll
Models.Company.Designer.cs.dll
Models.CompanyModel.cs.dll
Models.CompanyModel.Designer.cs.dll
jquery-2.1.0.min.map
FastPostback_Source.zip
ajax-loader.gif
icons-18-black.png
icons-18-white.png
icons-36-black.png
icons-36-white.png
ui-bg_flat_0_aaaaaa_40x100.png
ui-bg_flat_75_ffffff_40x100.png
ui-bg_glass_55_fbf9ee_1x400.png
ui-bg_glass_65_ffffff_1x400.png
ui-bg_glass_75_dadada_1x400.png
ui-bg_glass_75_e6e6e6_1x400.png
ui-bg_glass_95_fef1ec_1x400.png
ui-bg_highlight-soft_75_cccccc_1x100.png
ui-icons_222222_256x240.png
ui-icons_2e83ff_256x240.png
ui-icons_454545_256x240.png
ui-icons_888888_256x240.png
ui-icons_cd0a0a_256x240.png
ui-bg_flat_0_aaaaaa_40x100.png
ui-bg_flat_75_ffffff_40x100.png
ui-bg_glass_55_fbf9ee_1x400.png
ui-bg_glass_65_ffffff_1x400.png
ui-bg_glass_75_dadada_1x400.png
ui-bg_glass_75_e6e6e6_1x400.png
ui-bg_glass_95_fef1ec_1x400.png
ui-bg_highlight-soft_75_cccccc_1x100.png
ui-icons_222222_256x240.png
ui-icons_2e83ff_256x240.png
ui-icons_454545_256x240.png
ui-icons_888888_256x240.png
ui-icons_cd0a0a_256x240.png
FastPostback.csproj.user
favicon.ico
Global.asax
accent.png
bullet.png
heroAccent.png
orderedList0.png
orderedList1.png
orderedList2.png
orderedList3.png
orderedList4.png
CompanyModel.edmx
CompanyModel.edmx.diagram
<%@ Page Title="Model Binding and Fast Postback" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="FastPostback._Default" %>

<asp:Content runat="server" ID="FeaturedContent" ContentPlaceHolderID="FeaturedContent">
    <section class="featured">
        <div class="content-wrapper">
            <hgroup class="title">
                <h1><%: Title %></h1> <br />
                <h2>Simplified model binding with asp.net controls &amp; faster way to save data on postback.</h2>
            </hgroup>
            <p>
                This sample provides you an extermely simplified way to bind models both way with controls in asp.net web form and faster way to Save data
                by avoiding un-necessary events during postbacks. <br />
                This sample performs a basic CRUD operation on Employee table of the database. Click on the "Employee" link and debug to see how it
                binds data and take advantage of a generic handler to avoid life cycle involved during postback when not needed.
            </p>
        </div>
    </section>
</asp:Content>
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
    <h3>This example explains the following:</h3>
    <p>Click on the <asp:HyperLink runat="server" NavigateUrl="~/Employee/List.aspx" Text="Employee"></asp:HyperLink> to view the demo.</p>
    <ol class="round">
        <li class="one">
            <h5>Automatic Model Binding</h5>
            This sample provides you a simplified way to bind your model with your asp.net server controls.
            The example provides you on how you can bind it for TextBox, HiddenField and DropDownList. 
            You may extend this example to bind all other controls.
        </li>
        <li class="two">
            <h5>Postback</h5>
            When asp.net MVC came to the market, many developers simply had switched to MVC because they have seen two major flaws in asp.net WebForm architecture.
            1. Testability and 2. Postback model. While other stuffs like ViewState, Static Control Ids was easy to overcome but postback model and testability was 
            hard to replace. <br />
            This sample provides you an easy way to work around on how you can omit all un-necessary life cycle events simply by using 
            Generic Handler instead of posting data back to the same page. Side by Side you will be able to retain the beauty and flexibility of LifeCycle of your 
            page for first time load or when ever needed. In this approach, you don't need to abondon any rich Server Side Controls which is designed to 
            provide you a huge set of flexibility and Rapid Application Development.
        </li>
    </ol>
</asp:Content>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Anurag Gandhi
Technical Lead
India India
Anurag Gandhi currently works in web application design/development and has done so for many years now as he is passionate about programming.
He is extensively involved in Asp.Net and Asp.Net MVC web application architecture, AngularJs, design and development. His languages of choice are C#, Asp.Net, MVC, Asp, C, C++. But he is familiar with many other coding languages. He works with MS Sql Server as the database architecture of choice.
He is active in programming communities and loves to share his knowledge with other developers whenever he gets the opportunity.
He is also a passionate chess player.
 
He can be contacted at: soft.gandhi@gmail.com
Follow on   Twitter   Google+

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.141223.1 | Last Updated 27 Apr 2014
Article Copyright 2013 by Anurag Gandhi
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid