Friday, October 13, 2006

Intercepting Calls to Functions of a Typed Dataset

One of the things that we need to implement when doing any web project, whether in classic ASP or in ASP.NET, is how to log the calls to the database portion of our application. This is necessary so that we will be able to monitor the SQL statements that our application is executing at run time. This helps in easing up a lot of problems when troubleshooting production code.


Saturday, October 07, 2006

ASP.NET TabbedWizard Control (WizardBasePage.cs)

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace MSJ.BaseControl
{
public abstract class WizardBasePage : System.Web.UI.Page
{
public abstract Wizard Wizard { get; set;}

protected void Page_Init(object sender, EventArgs e)
{
GetTabbedWizardBase().InitPartnerControls(this);
}


ASP.NET TabbedWizard Control (TabbedWizardEnumsAndConstants.cs)

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace MSJ.Utility
{
internal class WizardConstants
{
public static readonly string WebConfigKey_WizardStepIDPrefix = "WizardStepID";
}


ASP.NET TabbedWizard Control (TabbedWizardBase.cs)

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using MSJ.Utility;
using MSJ.BaseControl;

namespace MSJ.Controls
{
public abstract class TabbedWizardBase : System.Web.UI.UserControl
{
protected WizardBasePage _myPage = null;

#region -- Abstract Functions -- For Implementation of Inheritors --
/// <summary>
/// Resets the menu images to disabled mode.
/// </summary>
protected abstract void ResetMenuImagesToDisabled();


ASP.NET TabbedWizard Control (Putting It All Together)

1. Put the ff in your VS2005 web site/application project:
- TabbedWizardBase.cs
- WizardBasePage.cs
- TabbedWizardEnumsAndConstants.cs
- alternately, you can download the zip file here in my MSN group. (Unfortunately, you can not upload a file in a blog. Membership might be required to access it)
2. Create an "images" subfolder and put all your images there
3. Add a Web User control (say, MyTabbedControl) in your project. This will be the visible portion of your tab control.
- Inherit it from TabbedWizardBase as in the code below.


What a line of code

I didn't know this line of code (in any language) will make sense but apparently it does: auto l = [](){}; Look at all those bracke...