ASP.NET 2.0 #10: Top Five Reasons to Adore ASP.NET 2.0

First, ASP.NET’s themes and master pages facilities make it possible for to build Web applications in which the appearance of the pages is thoroughly abstracted away from the operation of the pages in a way that was not possible before.    Second, the Web Site Administration Tool makes it possible to manage user data for…

0

ASP.NET 2.0 #9: SQLCacheDependency

Here is the code for a user control that displays a report: the control only goes through the process of loading the report from disk and retrieving its data if the report that is to be displayed is not already in the ASP.NET cache, otherwise, it merely retrieves the report from the cache, which is much…

0

ASP.NET 2.0 #8: WebPart Page Sample

<%@ Page Language=”C#” MasterPageFile=”~/Masters/Interior.master” CompileWith=”Dashboard.aspx.cs” ClassName=”Dashboard_aspx” Title=”Business Intelligence Dashboard” %><%@ Register tagprefix=”ctl” TagName=”ReportControl” Src=”../CustomControls/ReportDisplay.ascx”%><asp:Content ContentPlaceHolderID=”InteriorContentPlaceHolder” Runat=server ID=”InteriorContent”><asp:WebPartManager ID=”PartManager” Runat=server /><table width=”100%” >    <tr>        <td width=”100%” align=”right” colspan=”2″>            <asp:WebPartPageMenu                 ID=”PageMenu”                 Runat=”server”                 Text=”<%$ Resources:Strings, PagePersonalizationCaption %>”                 DropDownAutoPostBack=”true”                DropDownButtonText=””>                <MenuStyle  CssClass=”Menu” />            </asp:WebPartPageMenu>        </td>    </tr>    <tr>        <td width=”70%”>        <table width=”100%”>            <tr>                <td>                    <table border=”1px”…

5

ASP.NET 2.0 #7: Data Access

Given the monumental success of Dan Brown’s novel, The Da Vinci Code, I must assume that many of you have read it.  For the handful of you who haven’t read it yet, it is a reinterpretation of Western history and sexuality, as well as a theory of the true nature and location of the Holy…

0

ASP.NET 2.0 #6: Personalization

Here’s the code by which one authorized user can access another’s personalization data:    branch = Profile.GetProfile(userName).Branch;   <Yawn/> That’s well documented.  But here is the code by which the authorized user can MODIFY another’s personalization data, which is not so well documented:   ASP.HttpProfile profile = Profile.GetProfile(userName); profile.SetPropertyValue(“Branch”, branchKey); profile.Save();  

0

ASP.NET 2.0 #5: Security II: Windows Server 2003 Authorization Manager Role Provider

Here’s my custom Windows Server 2003 Authorization Manager Role Provider:   using System;using System.Collections;using System.Configuration;using System.Web;using System.Web.Security; using AZROLESLib; public class AuthorizationManagerRoleProvider: RoleProvider{ private string name; private string applicationName; private string storeLocation; private AZROLESLib.AzAuthorizationStore store;  private const int AZ_AZSTORE_FORCE_APPLICATION_CLOSE = 0x10;  public AuthorizationManagerRoleProvider() {  }  private AZROLESLib.IAzApplication OpenApplication() {  return store.OpenApplication(this.applicationName, null); }  private void CloseApplication() {  //this.store.CloseApplication(this.ApplicationName, 0); }    #region Validation Routines private void ValidateUserName(string userName) {  if…

1

ASP.NET 2.0 #4: Security I: AD/AM Membership Provider

Here is my repaired version of Jit Ghosh’s AD/AM Membership Provider:    using System;using System.Configuration;using System.Web.Configuration;using System.Configuration.Provider;using System.Web.Security;using System.DirectoryServices;using System.Security.Cryptography;using System.Text;using System.IO; namespace CustomProviders{ /// <summary> /// Implements a custom provier for the ASP.NET 2.0 Membership Service.  /// This provider uses Microsoft Active Directory Application Mode as the storage system for user information /// </summary> public class ADAMMembershipProvider: MembershipProvider {…

5

ASP.NET 2.0 #3: Navigation

Let’s say that you have to, as I did once, develop a menu like the one illustrated here:     As users make selections from the menu, sub-menu items are revealed, while the selections that the user has already made are tracked at the top of the menu.    Besides the requirements for how the…

1

ASP.NET 2.0 #2: Master Pages

A realistic starting point for the coding on many Web projects is static mock-ups provided by a graphics designer.  What happens next?  One thing that might happen is that the project leader divides up the static mock-ups among the developers, along with copies of the written specifications, and tells everyone to build pages that look…

3

ASP.NET 2.0 #1: Themes and Skins Sample

The skin of a graphical user interface is the element that determines how that interface looks, or, conversely, a graphical user interface has a skin to the extent that its appearance can be controlled by manipulating a single element.     The customary way of making it possible to control the appearance of a Web page…

3