|
 |
|
 |
|
| Dynamic controls, postbacks and viewstate data Many developers out there use a well known technique for dynamically loading an .ascx into another custom .ascx. That technique is applied in the code behind and there are many variants of that code created by many developers out there.
The first thing you may know is that when a control is loaded into a asp.net page, it must be loaded every time a postback request is made to the server because it need to render itself every time until we decide to use a new control.
Our problem starts when the dynamically loaded control tries to read/write data from the viewstate and also when the loader control tries to do the same. The problem is that the viewstate data is only active between a few steps of the page lifecycle as we will see
|
| DynamicControlsPlaceholder - A placeholder that saves its child controls Problem:
ASP.NET gives a developer the opportunity to programmatically add controls to a web form using ParentControl.Controls.Add(new Control());
However, these controls are not persisted in any way thus having to be recreated for each subsequent request.
Goal:
To create a control that behaves like a placeholder but additionally handles recreating dynamic controls on subsequent requests.
|
|
|
|
|
|
|
|
|
| BASICS: ObjectDataSource Control ObjectDataSource is a new hybrid control for ASP.NET 2.0 This article shows an unusual use of the control to retrieve and display RSS Feed search results from the web, instead of getting data from a database. |
| Some Tips and Tricks for using an ObjectDataSource with a Gridview This article attempts to show a few tricks with the new Gridview that we have in asp.net 2.0. This article addresses using the ObjectDataSource to populate the Gridview. In this example the ObjectDataSource returns a generic collection of an object. There is some special coding that needs to happen to get the sorting of colums to work. I also show how to use the pager template to do custom navigation. I have also included a simple Gridview printing example.
The data source does not support sorting with IEnumerable data. Automatic sorting is only supported with DataView, DataTable, and DataSet |
|
 |
|
|
|
Development patterns
|
 |
|
 |
|
| Microsoft .NET Pet Shop 4.0 Microsoft® .NET Pet Shop 4.0 is the latest in Microsoft's series of benchmark applications. The benchmark compares the performance and scalability of this .NET Web application to the performance of an equivalent, revised, and fully optimized J2EE™ application developed by the Middleware Company |
| DataObjects.NET 2.0.7 released! DataObjects.NET is an object persistence layer for .NET Framework. It dramatically decreases development time by handling persistence of your classes transparently - DataObjects.NET PetShop sample (Microsoft's .NET Pet Shop clone) contains 3 times less business and data tier code then its original exposing much more features including access control and editing support! |
| Manipulating Persistent Data An object (entity instance) is either transient or persistent with respect to a particular ISession. Newly instantiated objects are, of course, transient. The session offers services for saving (ie. persisting) transient instances:
|
| DataObjects.net Based applications Architecture overview of DataObjects.net |
| Custom Data Binding, Part 2 Summary: In part two, the custom data binding journey continues with a brief look at the role BindingList plays in allowing BindingSource to convert a single type into a list data source. We also look at situations where relying on the BindingSource isn't enough, such as sorting and searching. Such features need you to go a step further and create your own BindingList implementation with the additional support, which we also look at. To top it off, game data serialization is added to make life easier. (14 printed pages)
|
| Being Ignorant with LINQ to SQL LINQ to SQL differs from LINQ to Objects in that it is about working with objects that are persistent; in other words have a lifetime beyond the application. There are different styles to dealing with persistence; preference for one or the other is usually dependent on whether our perspective is data-centric or domain-centric.
|
| An extended library of collection classes for .NET The project was initiated by a suggestion of Peter Sestoft to further develop a library of collection
classes for the .Net platform he had developed during a stay at Microsoft Research at Cambridge.
The goal was to achieve a library of collection classes with a level of functionality like the library of
the Java platform, where the standard .Net collection classes are much more limited in range. Peter
was an active and inspiring advisor for the project, many thanks for that. |
| On the Way to Mastering ASP.NET: Introducing Custom Entity Classes Summary: There are situations for which untyped DataSets may not be the best solution for data manipulation. The goal of this guide is to explore an alternative to DataSets: custom entities and collections |
| Passing Values between ASP.NET Web Forms ASP.NET web forms provide excellent event driven programming model to developers. This does simplifies the overall design of your application but poses some problems of its own. For example, in traditional ASP you can easily pass values from one ASP page to another ASP page using POST. The same thing is not possible in ASP.NET if you want to stick to web form model (i.e. Server side form and control processing.). There are, however, some ways that can be used to overcome this situation. This article examines various possibilities to do the same. More specifically we will cover how to pass values using querystring, how to use session variables to do the same and finally how to use Server.Transfer method to do that |
|
|
|
|
|
|
|
|
 |
|
|
|
Data layers
|
 |
|
 |
|
| Building Layered Web Applications with Microsoft ASP.NET 2.0 This is part 1 of the article series "Building Layered Web Applications" that shows you how to build N-Layer applications with Microsoft ASP.NET 2.0. These articles teach you how to design, build and use custom business objects in your web application. The target audience for this series are developers that are ready to make the switch from using SqlDataSource controls to ObjectDataSource controls with custom business objects. Experience with ASP.NET 2 and C# is necessary while some knowledge about object oriented design certainly helps. The design I am going to show you in these articles is a simplified version of a design you would use in a real world application. It doesn't feature all the necessary functionality your application needs, but instead focuses on the underlying concepts.
|
| Creating a Data Access Layer There are two patterns commonly used for inserting, updating, and deleting data. The first pattern, which I'll call the database direct pattern, involves creating methods that, when invoked, issue an INSERT, UPDATE, or DELETE command to the database that operates on a single database record. Such methods are typically passed in a series of scalar values (integers, strings, Booleans, DateTimes, and so on) that correspond to the values to insert, update, or delete. For example, with this pattern for the Products table the delete method would take in an integer parameter, indicating the ProductID of the record to delete, while the insert method would take in a string for the ProductName, a decimal for the UnitPrice, an integer for the UnitsOnStock, and so on |
|
|
|
|
|
|
|
|
|
|