Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 3 of 3

Thread: How to create a new .Net with C# page and integrate to ASPDotNetStoreFront

  1. #1
    lishamanoj is offline Junior Member
    Join Date
    Sep 2010
    Posts
    1

    Default How to create a new .Net with C# page and integrate to ASPDotNetStoreFront

    Hi,

    I'm new to ASPDotNetStoreFront.

    I would like to customize by adding new forms to Store Front product.

    It would be great if anybody can help me for the following:
    1) Is there any procedure that I need to follow in AspDotNetStoreFront to add new table
    2) Is there any procedure that I need to follow in AspDotNetStoreFront to add new ASPX pages

    Thanks a lot in advance!

    Thanks,
    L

  2. #2
    sbeheshti is offline Junior Member
    Join Date
    Sep 2010
    Location
    Pennsylvania
    Posts
    9

    Default

    I am interested to know as well. Please let me know if you find out

  3. #3
    esedirect is offline Senior Member
    Join Date
    Feb 2010
    Location
    Norfolk, UK
    Posts
    343

    Default

    We use such a customisation with our request a catalogue page http://www.esedirect.co.uk/requestcatalog.aspx - it posts requests into a table in the database. Here are the component parts.

    Some names may have been changed to protect the innocent!

    The table definition:
    Code:
    CREATE TABLE [dbo].[_Requests](
        [ReqNo] [int] IDENTITY(1,1) NOT NULL,
        [ReqDtTm] [smalldatetime] NULL CONSTRAINT [DF_Requests_ReqDtTm]  DEFAULT (getdate()),
        [CompanyNm] [nvarchar](255) NULL,
        [ContactFirst] [nvarchar](255) NULL,
        [ContactLast] [nvarchar](50) NULL,
        [JobTtl] [nvarchar](255) NULL,
        [Addr1] [nvarchar](255) NULL,
        [Addr2] [nvarchar](255) NULL,
        [Town] [nvarchar](255) NULL,
        [County] [nvarchar](255) NULL,
        [PCode] [nvarchar](20) NULL,
        [TelArea] [nvarchar](20) NULL,
        [TelNo] [nvarchar](20) NULL,
        [FaxArea] [nvarchar](20) NULL,
        [FaxNo] [nvarchar](20) NULL,
        [Email] [nvarchar](255) NULL,
        [TypeBus] [nvarchar](50) NULL,
        [CompNotes] [nvarchar](255) NULL,
        [CompYrEnd] [nvarchar](9) NULL,
        [SizeBus] [nvarchar](6) NULL,
        [Processed] [bit] NOT NULL CONSTRAINT [DF_Requests_Processed]  DEFAULT (0),
        [Accepted] [bit] NOT NULL CONSTRAINT [DF_Requests_Accepted]  DEFAULT (0),
        [CopiedToCRM] [bit] NULL CONSTRAINT [DF_Requests_CopiedToCRM]  DEFAULT (0),
        [OtherTypeBus] [nvarchar](50) NULL,
        [ip_address] [varchar](50) NULL,
     CONSTRAINT [PK__Requests] PRIMARY KEY CLUSTERED 
    (
        [ReqNo] ASC
    )WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
    ) ON [PRIMARY]
    A stored procedure to insert the record:
    Code:
    CREATE PROCEDURE [dbo].[_Insert_Cat_Request]
        -- Add the parameters for the stored procedure here
        @CompanyNm NVARCHAR(255) = NULL,
        @ContactFirst NVARCHAR(255) = NULL,
        @ContactLast NVARCHAR(255) = NULL,
        @JobTtl NVARCHAR(255) = NULL,
        @Addr1 NVARCHAR(255) = NULL,
        @Addr2 NVARCHAR(255) = NULL,
        @Town NVARCHAR(255) = NULL,
        @County NVARCHAR(255) = NULL,
        @PCode NVARCHAR(20) = NULL,
        @TelArea NVARCHAR(20) = NULL,
        @TelNo NVARCHAR(20) = NULL,
        @FaxArea NVARCHAR(20) = NULL,
        @FaxNo NVARCHAR(20) = NULL,
        @Email NVARCHAR(255) = NULL,
        @TypeBus NVARCHAR(50) = NULL,
        @CompNotes NVARCHAR(255) = NULL,
        @CompYrEnd NVARCHAR(9) = NULL,
        @SizeBus NVARCHAR(6) = NULL,
        @OtherTypeBus NVARCHAR(50) = NULL,
        @ip_address NVARCHAR(50) = NULL
    AS
    BEGIN
        -- SET NOCOUNT ON added to prevent extra result sets from
        -- interfering with SELECT statements.
        SET NOCOUNT ON;
    
    IF @CompanyNm = '' SET @CompanyNm = NULL
    IF @ContactFirst = '' SET @ContactFirst = NULL
    IF @ContactLast = '' SET @ContactLast = NULL
    IF @JobTtl = '' SET @JobTtl = NULL
    IF @Addr1 = '' SET @Addr1 = NULL
    IF @Addr2 = '' SET @Addr2 = NULL
    IF @Town = '' SET @Town = NULL
    IF @County = '' SET @County = NULL
    IF @PCode = '' SET @PCode = NULL
    IF @TelArea = '' SET @TelArea = NULL
    IF @TelNo = '' SET @TelNo = NULL
    IF @FaxArea = '' SET @FaxArea = NULL
    IF @FaxNo = '' SET @FaxNo = NULL
    IF @Email = '' SET @Email = NULL
    IF @TypeBus = '' SET @TypeBus = NULL
    IF @CompNotes = '' SET @CompNotes = NULL
    IF @CompYrEnd = '' SET @CompYrEnd = NULL
    IF @SizeBus = '' SET @SizeBus = NULL
    IF @OtherTypeBus = '' SET @OtherTypeBus = NULL
    IF @ip_address = '' SET @ip_address = NULL
    
        -- Insert statements for procedure here
    INSERT INTO [dbo].[_Requests]
               ([ReqDtTm]
               ,[CompanyNm]
               ,[ContactFirst]
               ,[ContactLast]
               ,[JobTtl]
               ,[Addr1]
               ,[Addr2]
               ,[Town]
               ,[County]
               ,[PCode]
               ,[TelArea]
               ,[TelNo]
               ,[FaxArea]
               ,[FaxNo]
               ,[Email]
               ,[TypeBus]
               ,[CompNotes]
               ,[CompYrEnd]
               ,[SizeBus]
               ,[Processed]
               ,[Accepted]
               ,[CopiedToCRM]
               ,[OtherTypeBus]
               ,[ip_address])
         VALUES
               (GETDATE()
               ,@CompanyNm
               ,@ContactFirst
               ,@ContactLast
               ,@JobTtl
               ,@Addr1
               ,@Addr2
               ,@Town
               ,@County
               ,@PCode
               ,@TelArea
               ,@TelNo
               ,@FaxArea
               ,@FaxNo
               ,@Email
               ,@TypeBus
               ,@CompNotes
               ,@CompYrEnd
               ,@SizeBus
               ,0
               ,0
               ,0
               ,@OtherTypeBus
               ,@ip_address)
    END
    The aspx page:
    Code:
    <%@ Page language="c#" Inherits="AspDotNetStorefront.requestcatalog" Title="fsdf" CodeFile="requestcatalog.aspx.cs" %>
    <%@ Register TagPrefix="aspdnsf" TagName="XmlPackage" src="XmlPackageControl.ascx" %>
    <html>
    <head>
    
        <title>Request your free catalogue</title>
    </head>
    <body>
        <form runat="server">
            <asp:Panel ID="pnlCatalogRequest" HorizontalAlign="left" runat="server">
            <fieldset style="border: dashed 1px grey;">
            <strong><asp:Label ID="requestcatalog_aspx_7" runat="server" Font-Bold="true"></asp:Label></strong>
                <table>
                    <tr><td colspan="2">Fields marked with an <span style="color:Red;">*</span> are required</td></tr>
                    <tr><td colspan="2"><asp:ValidationSummary ID="valSummary" ForeColor="Red" Font-Bold="true" DisplayMode="List" ShowSummary="true" runat="server" EnableClientScript="true" /></td></tr>
                    <tr><td align="right"><asp:Literal ID="requestcatalog_aspx_12" runat="server" Mode="PassThrough"></asp:Literal></td><td><asp:TextBox ID="txtCompany" runat="server" MaxLength="60" Columns="65"></asp:TextBox></td></tr>
                    <tr><td align="right">Job Title:</td><td><asp:TextBox ID="txtJobTitle" runat="server" MaxLength="30" Columns="35"></asp:TextBox></td></tr>
                    <tr><td align="right"><asp:Literal ID="requestcatalog_aspx_8" runat="server" Mode="PassThrough"></asp:Literal></td><td><asp:TextBox ID="txtFirstName" runat="server" MaxLength="30" Columns="35" CausesValidation="true"></asp:TextBox><asp:RequiredFieldValidator ID="reqFName" runat="server" ControlToValidate="txtFirstName" EnableClientScript="true" Display="None"></asp:RequiredFieldValidator></td></tr>
                    <tr><td align="right"><asp:Literal ID="requestcatalog_aspx_10" runat="server" Mode="PassThrough"></asp:Literal></td><td><asp:TextBox ID="txtLastName" runat="server" MaxLength="40" Columns="35" CausesValidation="true"></asp:TextBox><asp:RequiredFieldValidator ID="reqLName" runat="server" ControlToValidate="txtLastName" EnableClientScript="true" Display="None"></asp:RequiredFieldValidator></td></tr>
                    <tr><td colspan="2">&nbsp;</td></tr>
                    <tr>
                        <td align="right" valign="top">
                            <span style="color:Red;">*</span>
                            <asp:Literal ID="requestcatalog_aspx_21" runat="server" Mode="PassThrough"></asp:Literal>
                        </td>
                        <td valign="top">
                            <asp:TextBox ID="txtZip" runat="server" MaxLength="10" Columns="10" CausesValidation="true"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="reqZip" runat="server" ControlToValidate="txtZip" EnableClientScript="true" Display="None"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr><td align="right"><asp:Literal ID="requestcatalog_aspx_13" runat="server" Mode="PassThrough"></asp:Literal></td><td><asp:TextBox ID="txtAddr1" runat="server" MaxLength="40" Columns="45" CausesValidation="true"></asp:TextBox><asp:RequiredFieldValidator ID="reqAddr1" runat="server" ControlToValidate="txtAddr1" EnableClientScript="true" Display="None"></asp:RequiredFieldValidator></td></tr>
                    <tr><td align="right"><asp:Literal ID="requestcatalog_aspx_15" runat="server" Mode="PassThrough"></asp:Literal></td><td><asp:TextBox ID="txtAddr2" runat="server" MaxLength="40" Columns="45"></asp:TextBox></td></tr>
                    <tr><td align="right"><asp:Literal ID="requestcatalog_aspx_17" runat="server" Mode="PassThrough"></asp:Literal></td><td><asp:TextBox ID="txtCity" runat="server" MaxLength="30" Columns="35" CausesValidation="true"></asp:TextBox><asp:RequiredFieldValidator ID="reqCity" runat="server" ControlToValidate="txtCity" EnableClientScript="true" Display="None"></asp:RequiredFieldValidator></td></tr>
                    <tr><td align="right">County:</td><td><asp:TextBox ID="txtCounty" runat="server" MaxLength="30" Columns="35"></asp:TextBox></td></tr>
                    <tr><td colspan="2">&nbsp;</td></tr>
                    <tr>
                        <td align="right"><span style="color:Red;">*</span>Telephone Number:</td>
                        <td>
                            (<asp:TextBox ID="Company_Telephone_Area" runat="server" MaxLength="5" Columns="6" CausesValidation="true"></asp:TextBox>)&nbsp;
                            <asp:TextBox ID="Company_Telephone" runat="server" MaxLength="6" Columns="7" CausesValidation="true"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="reqSTD" runat="server" ControlToValidate="Company_Telephone_Area" EnableClientScript="true" Display="None"></asp:RequiredFieldValidator>
                            <asp:RequiredFieldValidator ID="reqTelNo" runat="server" ControlToValidate="Company_Telephone" EnableClientScript="true" Display="None"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr><td align="right">Fax Number:</td><td>(<asp:TextBox ID="Company_Fax_Number_Area" runat="server" MaxLength="5" Columns="6"></asp:TextBox>)&nbsp;<asp:TextBox ID="Company_Fax_Number" runat="server" MaxLength="6" Columns="7"></asp:TextBox></td></tr>
                    <tr><td align="right"><span style="color:Red;">*</span>Email Address:</td><td><asp:TextBox ID="From" runat="server" MaxLength="255" Columns="40" CausesValidation="true"></asp:TextBox><asp:RequiredFieldValidator ID="reqEmail" runat="server" ControlToValidate="From" EnableClientScript="true" Display="None"></asp:RequiredFieldValidator></td></tr>
                    <tr><td align="right"><span style="color:Red;">*</span>Type of Business:</td><td><asp:DropDownList ID="ddlBusinessType" runat="server" CausesValidation="true"></asp:DropDownList><asp:RequiredFieldValidator ID="reqBusType" runat="server" ControlToValidate="ddlBusinessType" EnableClientScript="true" Display="None"></asp:RequiredFieldValidator></td></tr>
                    <tr><td align="right">Company Year End:</td><td><asp:DropDownList ID="ddlYearEnd" runat="server"></asp:DropDownList></td></tr>
                    <tr><td align="right">Size of Business:</td><td><asp:DropDownList ID="ddlBusinessSize" runat="server"></asp:DropDownList>&nbsp;employees</td></tr>
                    <tr><td valign="top"><span style="color:Red;">*</span>Please tell us more about your needs:</td><td><asp:TextBox ID="Notes" runat="server" MaxLength="255" Columns="40" Rows="5" TextMode="MultiLine" CausesValidation="true"></asp:TextBox><asp:RequiredFieldValidator ID="reqNotes" runat="server" ControlToValidate="Notes" EnableClientScript="true" Display="None"></asp:RequiredFieldValidator></td></tr>
                    <tr><td colspan="2" height="25"></td></tr>
                    <tr><td colspan="2" align="center">
    <!--            <asp:Button ID="btnContinue" runat="server" OnClick="btnContinue_OnClick" /> -->
                    <asp:ImageButton ImageUrl="skins/Skin_(!SKINID!)/images/newbuttons/requestcatalogue.jpg" runat="server" ID="ImgContinue" OnClick="ImgContinue_Click" AlternateText="Request Catalogue" ToolTip="Request Catalogue" />
                    </td></tr>
                </table>
            </fieldset>
            <p>For a preview of what our catalogue contains view our <a href="/t-e-catalogues.aspx">e-catalogues</a>.</p>
    
            <p>Please note that we are a <strong>UK Only</strong> supplier and we do not export.</p>
    
            <p>If, on receiving the catalogue, you have any questions or just want to discuss your requirements in more detail, please feel free to <a href="t-contact.aspx" rel="nofollow" title="View our contact details">contact us</a>.</p>
    
            <p>The security and integrity of information you leave on this website is of the utmost importance to us. Rest assured any personal information you leave will not be disclosed to any party outside of Eastern Storage Equipment Limited and its partner companies. If you are in any doubt, please <a href="t-contact.aspx" rel="nofollow" title="View our contact details">contact us</a>.</p>
            </asp:Panel>
            <asp:Panel ID="pnlSuccess" runat="server" Visible="false">
                <br /><asp:Label ID="lblSuccess" runat="server" Font-Bold="true"></asp:Label><br />
            </asp:Panel>
        </form>
    
    </body>
    </html>
    The code behind CS file:
    Code:
    // ------------------------------------------------------------------------------------------
    // Copyright AspDotNetStorefront.com, 1995-2009.  All Rights Reserved.
    // http://www.aspdotnetstorefront.com
    // For details on this license please visit  the product homepage at the URL above.
    // THE ABOVE NOTICE MUST REMAIN INTACT. 
    // ------------------------------------------------------------------------------------------
    using System;
    using System.Web;
    using System.Web.UI.WebControls;
    using System.Data;
    using System.Globalization;
    using AspDotNetStorefrontCore;
    using System.Data.SqlClient;
    
    namespace AspDotNetStorefront
    {
        /// <summary>
        /// Summary description for requestcatalog.
        /// </summary>
        public partial class requestcatalog : SkinBase
        {
            protected void Page_Load(object sender, System.EventArgs e)
            {
                if (AppLogic.AppConfigBool("GoNonSecureAgain"))
                {
                    SkinBase.GoNonSecureAgain();
                }
    
                // this may be overwridden by the XmlPackage below!
                SectionTitle = AppLogic.GetString("requestcatalog.aspx.1", SkinID, ThisCustomer.LocaleSetting);
    
                reqFName.ErrorMessage = AppLogic.GetString("requestcatalog.aspx.9", SkinID, ThisCustomer.LocaleSetting);
                reqLName.ErrorMessage = AppLogic.GetString("requestcatalog.aspx.11", SkinID, ThisCustomer.LocaleSetting);
                reqAddr1.ErrorMessage = AppLogic.GetString("requestcatalog.aspx.14", SkinID, ThisCustomer.LocaleSetting);
                reqCity.ErrorMessage = AppLogic.GetString("requestcatalog.aspx.18", SkinID, ThisCustomer.LocaleSetting);
                reqZip.ErrorMessage = AppLogic.GetString("requestcatalog.aspx.22", SkinID, ThisCustomer.LocaleSetting);
    
                /* ESE changes */
                reqEmail.ErrorMessage = "Please enter your email address";
                reqNotes.ErrorMessage = "Please give us more details of what you are looking for";
                reqBusType.ErrorMessage = "Please choose a business type";
                reqSTD.ErrorMessage = "Please enter the STD part of your telephone number";
                reqTelNo.ErrorMessage = "Please enter your telephone number";
                /* ESE changes */
                
                if (!IsPostBack)
                {
                    InitializePageContent();
                }
            }
    
    
            public void btnContinue_OnClick(object sender, EventArgs e)
            {
                Page.Validate();
                if (Page.IsValid)
                {
                    string FormInput = "<b>" + AppLogic.GetString("requestcatalog.aspx.2", SkinID, ThisCustomer.LocaleSetting) + "</b><br/><br/>";
                    FormInput += "Customer Name: " + txtFirstName.Text + " " + txtLastName.Text + "<br/>\n";
                    FormInput += "Company: " + txtCompany.Text + "<br/>\n";
                    FormInput += "Job Title: " + txtJobTitle.Text + "<br/>\n";
                    FormInput += "Address1: " + txtAddr1.Text + "<br/>\n";
                    FormInput += "Address2: " + txtAddr2.Text + "<br/>\n";
                    FormInput += "City: " + txtCity.Text + "<br/>\n";
                    FormInput += "County: " + txtCounty.Text + "<br/>\n";
                    FormInput += "Postcode: " + txtZip.Text + "<br/>\n";
                    FormInput += "Tel No: (" + Company_Telephone_Area.Text + ") " + Company_Telephone.Text + "<br/>\n";
                    FormInput += "Fax No: (" + Company_Fax_Number_Area.Text + ") " + Company_Fax_Number.Text + "<br/>\n";
                    FormInput += "Email: " + From.Text + "<br/>\n";
                    FormInput += "Type of Business: " + ddlBusinessType.SelectedItem.Text + "<br/>\n";
                    FormInput += "Company Year End: " + ddlYearEnd.SelectedItem.Text + "<br/>\n";
                    FormInput += "Business Size: " + ddlBusinessSize.SelectedItem.Text + "<br/>\n";
                    FormInput += "Notes: " + Notes.Text + "<br/>\n<br/>\n";
                    lblSuccess.Text = String.Format(AppLogic.GetString("requestcatalog.aspx.4", SkinID, ThisCustomer.LocaleSetting), AppLogic.AppConfig("SE_MetaTitle"));
                    pnlCatalogRequest.Visible = false;
                    pnlSuccess.Visible = true;
    
                    /* ESE changes */
                    string sql = String.Empty;
                    sql = String.Format("@CompanyNm={0}", cleanString(txtCompany.Text));
                    sql += "," + String.Format("@ContactFirst={0}", cleanString(txtFirstName.Text));
                    sql += "," + String.Format("@ContactLast={0}", cleanString(txtLastName.Text));
                    sql += "," + String.Format("@JobTtl={0}", cleanString(txtJobTitle.Text));
                    sql += "," + String.Format("@Addr1={0}", cleanString(txtAddr1.Text));
                    sql += "," + String.Format("@Addr2={0}", cleanString(txtAddr2.Text));
                    sql += "," + String.Format("@Town={0}", cleanString(txtCity.Text));
                    sql += "," + String.Format("@County={0}", cleanString(txtCounty.Text));
                    sql += "," + String.Format("@PCode={0}", cleanString(txtZip.Text));
                    sql += "," + String.Format("@TelArea={0}", cleanString(Company_Telephone_Area.Text));
                    sql += "," + String.Format("@TelNo={0}", cleanString(Company_Telephone.Text));
                    sql += "," + String.Format("@FaxArea={0}", cleanString(Company_Fax_Number_Area.Text));
                    sql += "," + String.Format("@FaxNo={0}", cleanString(Company_Fax_Number.Text));
                    sql += "," + String.Format("@Email={0}", cleanString(From.Text));
                    sql += "," + String.Format("@TypeBus={0}", cleanString(ddlBusinessType.SelectedItem.Value));
                    sql += "," + String.Format("@CompNotes={0}", cleanString(Notes.Text));
                    sql += "," + String.Format("@CompYrEnd={0}", cleanString(ddlYearEnd.SelectedItem.Value));
                    sql += "," + String.Format("@SizeBus={0}", cleanString(ddlBusinessSize.SelectedItem.Value));
                    sql += "," + String.Format("@ip_address={0}", cleanString(ThisCustomer.LastIPAddress));
                    DB.ExecuteSQL("exec _Insert_Cat_Request " + sql);
                    String FromAddress = "yourname@yourdomainname.com"; // reply to
                    String ToAddress = "yourname@yourdomainname.com"; // destination
                    //String BotAddress = AppLogic.AppConfig("ReceiptEMailFrom");
                    String BotAddress = "yourname@yourdomainname.com"; // from
                    String Subject = "Catalogue Request";
                    AppLogic.SendMail(Subject, FormInput, true, BotAddress, BotAddress, ToAddress, ToAddress, "", FromAddress, AppLogic.MailServer());
                    /* ESE changes */
                }
                else
                {
                    InitializePageContent();
                }
            }
    
            private String cleanString(String pString)
            {
                pString = pString.Trim();
                pString = DB.SQuote(pString);
                return pString;
            }
    
            public void reqState_OnServerValidate(Object sender, ServerValidateEventArgs args)
            {
                if (args.Value == "0")
                {
                    args.IsValid = false;
                }
                else
                {
                    args.IsValid = true;
                }
            }
    
    
            private void InitializePageContent()
            {
                
                SetMetaTags("Free ESE Catalogue - ESE Direct - Eastern Storage Equipment", "", 
                            "Request your free catalogue from ESE Direct. Buy from a range of industrial products including shelving and racking!", "");
                
                requestcatalog_aspx_7.Text = AppLogic.GetString("requestcatalog.aspx.7", SkinID, ThisCustomer.LocaleSetting);
                requestcatalog_aspx_8.Text = AppLogic.GetString("requestcatalog.aspx.8", SkinID, ThisCustomer.LocaleSetting);
                requestcatalog_aspx_10.Text = AppLogic.GetString("requestcatalog.aspx.10", SkinID, ThisCustomer.LocaleSetting);
                requestcatalog_aspx_12.Text = AppLogic.GetString("requestcatalog.aspx.12", SkinID, ThisCustomer.LocaleSetting);
                /* address_cs_58.Text = AppLogic.GetString("address.cs.58", SkinID, ThisCustomer.LocaleSetting);*/
                requestcatalog_aspx_13.Text = AppLogic.GetString("requestcatalog.aspx.13", SkinID, ThisCustomer.LocaleSetting);
                requestcatalog_aspx_15.Text = AppLogic.GetString("requestcatalog.aspx.15", SkinID, ThisCustomer.LocaleSetting);
                /*requestcatalog_aspx_16.Text = AppLogic.GetString("requestcatalog.aspx.16", SkinID, ThisCustomer.LocaleSetting);*/
                requestcatalog_aspx_17.Text = AppLogic.GetString("requestcatalog.aspx.17", SkinID, ThisCustomer.LocaleSetting);
                /*requestcatalog_aspx_19.Text = AppLogic.GetString("requestcatalog.aspx.19", SkinID, ThisCustomer.LocaleSetting);*/
                requestcatalog_aspx_21.Text = AppLogic.GetString("requestcatalog.aspx.21", SkinID, ThisCustomer.LocaleSetting);
                /*requestcatalog_aspx_24.Text = AppLogic.GetString("requestcatalog.aspx.24", SkinID, ThisCustomer.LocaleSetting);*/
                btnContinue.Text = AppLogic.GetString("requestcatalog.aspx.25", SkinID, ThisCustomer.LocaleSetting);
                AppLogic.GetButtonDisable(btnContinue);
    
                Address ShippingAddress = new Address();
                ShippingAddress.LoadByCustomer(ThisCustomer.CustomerID,ThisCustomer.PrimaryBillingAddressID,AddressTypes.Shipping);
    
                txtFirstName.Text = ShippingAddress.FirstName;
                txtLastName.Text = ShippingAddress.LastName;
                txtCompany.Text = ShippingAddress.Company;
                txtAddr1.Text = ShippingAddress.Address1;
                txtAddr2.Text = ShippingAddress.Address2;
                txtCounty.Text = ShippingAddress.Suite;
                txtCity.Text = ShippingAddress.City;
                txtZip.Text = ShippingAddress.Zip;
                From.Text = ShippingAddress.EMail;
    
                /* ESE changes */
                using (SqlConnection conn = DB.dbConn())
                {
                    conn.Open();
                    using (IDataReader dr = DB.GetRS("select * from _eseBusiness with (NOLOCK) order by display_order, business_type", conn))
                    {
                        ddlBusinessType.DataSource = dr;
                        ddlBusinessType.DataTextField = "business_type";
                        ddlBusinessType.DataValueField = "business_type";
                        ddlBusinessType.DataBind();
                    }
                }
                ddlBusinessType.Items.Insert(0, new ListItem(AppLogic.GetString("requestcatalog.aspx.20", SkinID, ThisCustomer.LocaleSetting), ""));
    
                ddlBusinessSize.Items.Insert(0, new ListItem("100+", "100+"));
                ddlBusinessSize.Items.Insert(0, new ListItem("51-100", "51-100"));
                ddlBusinessSize.Items.Insert(0, new ListItem("21-50", "21-50"));
                ddlBusinessSize.Items.Insert(0, new ListItem("11-20", "11-20"));
                ddlBusinessSize.Items.Insert(0, new ListItem("6-10", "6-10"));
                ddlBusinessSize.Items.Insert(0, new ListItem("1-5", "1-5"));
                ddlBusinessSize.Items.Insert(0, new ListItem(AppLogic.GetString("requestcatalog.aspx.20", SkinID, ThisCustomer.LocaleSetting), ""));
    
                ddlYearEnd.Items.Insert(0, new ListItem("December", "December"));
                ddlYearEnd.Items.Insert(0, new ListItem("November", "November"));
                ddlYearEnd.Items.Insert(0, new ListItem("October", "October"));
                ddlYearEnd.Items.Insert(0, new ListItem("September", "September"));
                ddlYearEnd.Items.Insert(0, new ListItem("August", "August"));
                ddlYearEnd.Items.Insert(0, new ListItem("July", "July"));
                ddlYearEnd.Items.Insert(0, new ListItem("June", "June"));
                ddlYearEnd.Items.Insert(0, new ListItem("May", "May"));
                ddlYearEnd.Items.Insert(0, new ListItem("April", "April"));
                ddlYearEnd.Items.Insert(0, new ListItem("March", "March"));
                ddlYearEnd.Items.Insert(0, new ListItem("February", "February"));
                ddlYearEnd.Items.Insert(0, new ListItem("January", "January"));
                ddlYearEnd.Items.Insert(0, new ListItem(AppLogic.GetString("requestcatalog.aspx.20", SkinID, ThisCustomer.LocaleSetting), ""));
                /* ESE changes */
    
    /*
                using (SqlConnection conn = DB.dbConn())
                {
                    conn.Open();
                    using (IDataReader dr = DB.GetRS("select * from State with (NOLOCK) order by DisplayOrder,Name", conn))
                    {
                        ddlState.DataSource = dr;
                        ddlState.DataTextField = "name";
                        ddlState.DataValueField = "Abbreviation";
                        ddlState.DataBind();                    
                    }
                }
                ddlState.Items.Insert(0, new ListItem(AppLogic.GetString("requestcatalog.aspx.20", SkinID, ThisCustomer.LocaleSetting), "0"));
                ddlState.SelectedValue = ShippingAddress.State;
    
                using (SqlConnection conn = DB.dbConn())
                {
                    conn.Open();
                    using (IDataReader dr2 = DB.GetRS("select * from Country with (NOLOCK) where Published = 1 order by DisplayOrder,Name", conn))
                    {
                        ddlCountry.DataSource = dr2;
                        ddlCountry.DataTextField = "Name";
                        ddlCountry.DataValueField = "Name";
                        ddlCountry.DataBind();
                    }
                }
                ddlCountry.Items.Insert(0, new ListItem(AppLogic.GetString("requestcatalog.aspx.20", SkinID, ThisCustomer.LocaleSetting), "0"));
                ddlCountry.SelectedValue = ShippingAddress.Country;
    */
            }
            
            protected void ImgContinue_Click(object sender, EventArgs e)
            {
                Page.Validate();
                if (Page.IsValid)
                {
                    string FormInput = "<b>" + AppLogic.GetString("requestcatalog.aspx.2", SkinID, ThisCustomer.LocaleSetting) + "</b><br/><br/>";
                    FormInput += "Customer Name: " + txtFirstName.Text + " " + txtLastName.Text + "<br/>\n";
                    FormInput += "Company: " + txtCompany.Text + "<br/>\n";
                    FormInput += "Job Title: " + txtJobTitle.Text + "<br/>\n";
                    FormInput += "Address1: " + txtAddr1.Text + "<br/>\n";
                    FormInput += "Address2: " + txtAddr2.Text + "<br/>\n";
                    FormInput += "City: " + txtCity.Text + "<br/>\n";
                    FormInput += "County: " + txtCounty.Text + "<br/>\n";
                    FormInput += "Postcode: " + txtZip.Text + "<br/>\n";
                    FormInput += "Tel No: (" + Company_Telephone_Area.Text + ") " + Company_Telephone.Text + "<br/>\n";
                    FormInput += "Fax No: (" + Company_Fax_Number_Area.Text + ") " + Company_Fax_Number.Text + "<br/>\n";
                    FormInput += "Email: " + From.Text + "<br/>\n";
                    FormInput += "Type of Business: " + ddlBusinessType.SelectedItem.Text + "<br/>\n";
                    FormInput += "Company Year End: " + ddlYearEnd.SelectedItem.Text + "<br/>\n";
                    FormInput += "Business Size: " + ddlBusinessSize.SelectedItem.Text + "<br/>\n";
                    FormInput += "Notes: " + Notes.Text + "<br/>\n<br/>\n";
                    lblSuccess.Text = String.Format(AppLogic.GetString("requestcatalog.aspx.4", SkinID, ThisCustomer.LocaleSetting), AppLogic.AppConfig("SE_MetaTitle"));
                    pnlCatalogRequest.Visible = false;
                    pnlSuccess.Visible = true;
    
                    /* ESE changes */
                    string sql = String.Empty;
                    sql = String.Format("@CompanyNm={0}", cleanString(txtCompany.Text));
                    sql += "," + String.Format("@ContactFirst={0}", cleanString(txtFirstName.Text));
                    sql += "," + String.Format("@ContactLast={0}", cleanString(txtLastName.Text));
                    sql += "," + String.Format("@JobTtl={0}", cleanString(txtJobTitle.Text));
                    sql += "," + String.Format("@Addr1={0}", cleanString(txtAddr1.Text));
                    sql += "," + String.Format("@Addr2={0}", cleanString(txtAddr2.Text));
                    sql += "," + String.Format("@Town={0}", cleanString(txtCity.Text));
                    sql += "," + String.Format("@County={0}", cleanString(txtCounty.Text));
                    sql += "," + String.Format("@PCode={0}", cleanString(txtZip.Text));
                    sql += "," + String.Format("@TelArea={0}", cleanString(Company_Telephone_Area.Text));
                    sql += "," + String.Format("@TelNo={0}", cleanString(Company_Telephone.Text));
                    sql += "," + String.Format("@FaxArea={0}", cleanString(Company_Fax_Number_Area.Text));
                    sql += "," + String.Format("@FaxNo={0}", cleanString(Company_Fax_Number.Text));
                    sql += "," + String.Format("@Email={0}", cleanString(From.Text));
                    sql += "," + String.Format("@TypeBus={0}", cleanString(ddlBusinessType.SelectedItem.Value));
                    sql += "," + String.Format("@CompNotes={0}", cleanString(Notes.Text));
                    sql += "," + String.Format("@CompYrEnd={0}", cleanString(ddlYearEnd.SelectedItem.Value));
                    sql += "," + String.Format("@SizeBus={0}", cleanString(ddlBusinessSize.SelectedItem.Value));
                    sql += "," + String.Format("@ip_address={0}", cleanString(ThisCustomer.LastIPAddress));
                    DB.ExecuteSQL("exec _Insert_Cat_Request " + sql);
                    String FromAddress = "yourname@yourdomainname.com"; // reply to
                    String ToAddress = "yourname@yourdomainname.com"; // destination
                    //String BotAddress = AppLogic.AppConfig("ReceiptEMailFrom");
                    String BotAddress = "yourname@yourdomainname.com"; // from
                    String Subject = "Catalogue Request";
                    AppLogic.SendMail(Subject, FormInput, true, BotAddress, BotAddress, ToAddress, ToAddress, "", FromAddress, AppLogic.MailServer());
                    /* ESE changes */
                }
                else
                {
                    InitializePageContent();
                }
            }
        }
    }
    Happy customising!
    No support is given for this not working in your environment!
    http://www.esedirect.co.uk
    --------------------------------------------------------------------------
    Using MS 9.2.0.0 with the following customisations:

    Lightbox/Fancybox enlarged images;
    Auto-suggest searchbox;
    Extra product information shown only to our IP Address (such as supplier info, costs, etc.);
    Failed transactions emailed via trigger;
    Custom app to show basket contents when customer online;
    Orders pushed through to accounting systems.

    All the above without source!