Log In
       Innovative Solutions to Your Evolving Requirements

Examining the Separation of Duty
in an OO Web Content Page

a working example within an OO Web Forms web template



the Essence

In this technical article, you can examine a working Content Page example, along with the c# and XHTML source code behind the component. This example is in production and contains references to an independent and custom base page class and master page.  It takes advantage of the ASP.NET Framework and OO programming, plus it's not just theory.

Why are we here?

Good reasons for reading further...

  • To see how little c# is required in the Content Page code-behind

  • To notice that there is no c# or XHTML required in the content page to handle mobile 

  • Tablet, Mobile, and Theatre Views are accomplished via a single master page c# code-behind (along with appropriately written XHTML in the content page). 

  • We offer a product with c# source code for license that includes everything you need to start tweaking your existing your web pages for mobile within hours.  Here are page links for more info on our Mobile ASPX - TechCrystals Code Package™--> Visual Studio Project TemplatesFeatures and Benefits,  Product Contents SummaryIntroduction.

  • to match the functions of a working content page on this website (About Us) with the small amount of standardized c# it takes to do the triggering

  • To gain at least some insight to the implied web project template and structure, which largely eliminates the requirements for an MVC or responsive rewrite for existing web forms sites

  • You are evaluating website design or architectural patterns

  • To notice how many of the cool and advanced features can be separated and isolated without duplication, and where they exist code-wise outside of the content page in our template pattern.  By the way, we offer this complete template for license in our Web Base for ASPX - TechCrystals Code Package.

  • This is a web forms example that works with web application projects and website projects, in C# or vb.net and even some 3rd party languages

  • Even though the web forms project types are being dismissed by some at this juncture, an OO web template just might prove more than satisfactory for your application design pattern (or architectural) interests, while then making it significantly easier for agile focus on user requirements



code-behind for the Content Page with this design pattern
Here is all of the c# code required for the Content Page in this OO framework.


web page code-behind written in c#

//***********************************************************

//   This source code contains confidential and proprietary *

//   information of Tegratecs Development Corp.®            *

//                                                          *

//      Copyright 2017 by Tegratecs Development Corp.®      *

//      Copyright 2018 by Tegratecs Development Corp.®      *

//      Copyright 2019 by Tegratecs Development Corp.®      *

//      Copyright 2020 by Tegratecs Development Corp.®      *

//                   All Rights Reserved.                   *

//                                                          *

//***********************************************************


using System;

using System.Collections;

using System.Configuration;

using System.Data;

using System.Linq;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.HtmlControls;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

 

namespace nsTegratecsWSv10

{

    public partial class AboutUs : WebUIPageExtendedForTegratecsWebBase

    {

        // begin standard global variables for the web page class

        private String strThisPageURL;

        private System.Collections.ArrayList arrlstPagesVisited;

        private System.Collections.ArrayList arrlstPagesVisitedLastControl;

        // master page    

        SiteLevelMasterPageCSv4 MyMasterPage;

        //    When using 1 master page, the page life-cycle events are intertwined between the content page and the master page

        //    Here is the sequence of events...

        //  =========================

        //    master Page_Init

        //  -------------------------

        //    content       Page_Init

        //    content       Page_Pre_Render

        //    content       Page_Load

        //  -------------------------

        //    master Page_Load

        //    master Page_Pre-Render

        //    master Page_Unload

        //  -------------------------

        //    content       Page_Unload  

        //  =========================

 

        //********************************************************************************************************************

        //  Use Page_Init routine to force proper usage of SSL on secured and private pages (done in base.srPage_Init2_FPStd

        //********************************************************************************************************************

        protected void Page_Init(Object sender, EventArgs e)

        {

            // populate all of these global variables inside of the master page at this time (master already ran it's Page_Init)

            MyMasterPage = this.Master as SiteLevelMasterPageCSv4;

            // continue with the custom Event Log string builder object already in progress from master page

            base.strbldrEvtLogBase = MyMasterPage.strbldrMasterPageEvtLog;

            this.strThisPageURL = MyMasterPage.strThisPageURL;

            base.srPage_Init2_FPStd(ref strThisPageURL, ref arrlstPagesVisited, ref arrlstPagesVisitedLastControl);

            if (base.clsCustCtcActs.boolpropSignInStatus)

            {

                // update my account info

                Table0.Rows[0].Visible = false;

                Table0.Rows[1].Visible = true;

            }

            else

            {

                //  join or sign in

                Table0.Rows[0].Visible = true;

                Table0.Rows[1].Visible = false;

            }

            MyMasterPage.arrlstPagesVisited = arrlstPagesVisited;

            MyMasterPage.arrlstPagesVisitedLastControl = arrlstPagesVisitedLastControl;

            MyMasterPage.boolSignInStatus = base.clsCustCtcActs.boolpropSignInStatus;

            MyMasterPage.strContactGreetingMsg = base.clsCustCtcActs.strpropContactGreetingMsg;

            MyMasterPage.strMemberStatus = base.clsCustCtcActs.strpropMemberStatus;

            MyMasterPage.strInternetContactUserID = base.clsCustCtcActs.strpropInternetContactUserID;

            MyMasterPage.strPasswordType = base.clsCustCtcActs.strpropPasswordType;

            MyMasterPage.intContactUniqueID = base.clsCustCtcActs.intpropContactUniqueID;

            MyMasterPage.boolFPUserCodeExists = base.clsCustCtcActs.boolpropFPUserCodeExists;

            // Panel2 and Panel13 areas essentially invisible and disabled for use at this time

            Panel2.Visible = false;

            Panel2.Enabled = false;

            Panel13.Visible = false;

            Panel13.Enabled = false;

 

            // add event handler for msg box button (on master page's pop-up message box (could be needed by srStdDigitalResourceAccessWrapper)

            MyMasterPage.cmdevnhdlMsgBoxOKClicked += this.btnMsgBoxOKFromMasterPage;

        }

 

        protected void Page_Load(Object sender, EventArgs e)

        {

            base.srPage_Load_Part_1_FPStd(strThisPageURL, ref arrlstPagesVisited, ref arrlstPagesVisitedLastControl);

            if (Page.IsPostBack == false)

            {

                //

                // Called the first time that the page is loaded or if a Redirect is used regardless of previously displayed page

                //

                // essentially just .focus() on control causing submit

                base.srPage_Load_Part_2_FPStd(strThisPageURL, ref arrlstPagesVisited, ref arrlstPagesVisitedLastControl);

            }

            else

            {

                // Page.IsPostBack occurs essentially when a page is redisplayed (unless a Redirect is issued in the code)

                // Occurs even after timeout on button click event

                // Occurs even after browser's back button was used to get to the page where a button was clicked

                //  (however, careful - viewstate returned is old in this case - server did not see this page last)

            }

 

            base.srPage_LoadFinish_FPStd(strThisPageURL);

            // master page load will follow so that is where it is easiest to test for whether to display the custom event log

        }

 

        //**************************************************************************************************

        //  this routine is run each time this page is displayed (after the web server sends out the page)

        //  do not attempt to verify results of this routine by displaying something in the page

        //    (because the display of the page has already occurred by the time this routine runs)

        //**************************************************************************************************

        protected void Page_UnLoad(Object sender, EventArgs e)

        {

            base.srPage_UnLoad2_FPStd(strThisPageURL);

        }

 

        protected void btnContactUs_Click(Object sender, EventArgs e)

        {

            clsFdnWebCS.stcAddToSsttEvnLog2(strThisPageURL, clsFdnWebCS.stcstrfctGetCtrlID(sender as Control) + "_Click", "85", ref base.strbldrEvtLogBase);

            if (Session["ssv_UVPTriggerURL"] != null)

            {

                Session["ssv_UVPTriggerURL2Use"] = Session["ssv_UVPTriggerURL"].ToString();

                Session["ssv_UVPTriggerImage2Use"] = Session["ssv_UVPTriggerImage"].ToString();

            }

            Response.Redirect(ConfigurationManager.AppSettings["apkContactMePage"].ToString());

        }

 

        protected void btnCheckIn2_Click(Object sender, EventArgs e)

        {

            clsFdnWebCS.stcAddToSsttEvnLog2(strThisPageURL, clsFdnWebCS.stcstrfctGetCtrlID(sender as Control) + "_Click", "85", ref base.strbldrEvtLogBase);

            Response.Redirect(ConfigurationManager.AppSettings["apkContactRegistrationPage"]);

        }

 

        protected void btnBack1_Click(Object sender, EventArgs e)

        {

            clsFdnWebCS.stcAddToSsttEvnLog2(strThisPageURL, clsFdnWebCS.stcstrfctGetCtrlID(sender as Control) + "_Click", "85", ref base.strbldrEvtLogBase);

            clsStdPageNavOnlyCS.stcRedirectToPreviousPage(strThisPageURL, ref arrlstPagesVisited, ref arrlstPagesVisitedLastControl);

        }

 

        protected void lnkbtnRegister_Click(Object sender, EventArgs e)

        {

            clsFdnWebCS.stcAddToSsttEvnLog2(strThisPageURL, clsFdnWebCS.stcstrfctGetCtrlID(sender as Control) + "_Click", "85", ref base.strbldrEvtLogBase);

            Response.Redirect(ConfigurationManager.AppSettings["apkContactRegistrationPage"]);

        }

 

        protected void lnkbtnSignIn_Click(Object sender, EventArgs e)

        {

            clsFdnWebCS.stcAddToSsttEvnLog2(strThisPageURL, clsFdnWebCS.stcstrfctGetCtrlID(sender as Control) + "_Click", "85", ref base.strbldrEvtLogBase);

            Response.Redirect(nsFdnAnyCtxCS10.clsFdnAnyCtxCS10.strpropLogInPageName);

        }

 

        protected void lnkbtnUpdateMyContactInfo_Click(Object sender, EventArgs e)

        {

            clsFdnWebCS.stcAddToSsttEvnLog2(strThisPageURL, clsFdnWebCS.stcstrfctGetCtrlID(sender as Control) + "_Click", "85", ref base.strbldrEvtLogBase);

            Response.Redirect(ConfigurationManager.AppSettings["apkContactRegistrationPage"]);

        }

 

        protected void lnkbtnPlay1320ConverenceRoomVideosMP4_Click(Object sender, EventArgs e)

        {

            base.srStdDigitalResourceAccessWrapper(strThisPageURL, sender, "_Click", "*StandardResourceAccessFromTemp");

        }

 

        protected void imgbtnPlay1320ConverenceRoomVideosMP4_Click(Object sender, ImageClickEventArgs e)

        {

            imgbtnPlay1320ConverenceRoomVideosMP4.Focus();

            base.srStdDigitalResourceAccessWrapper(strThisPageURL, sender, "_Click", "*StandardResourceAccessFromTemp");

        }

 

        protected void lnkbtnPlayUnboxingTegratecsNewIBMPower9TowerModelServerMP4_Click(Object sender, EventArgs e)

        {

            base.srStdDigitalResourceAccessWrapper(strThisPageURL, sender, "_Click", "*StandardResourceAccessFromTemp");

        }

 

        protected void imgbtnPlayUnboxingTegratecsNewIBMPower9TowerModelServerMP4_Click(Object sender, ImageClickEventArgs e)

        {

            imgbtnPlayUnboxingTegratecsNewIBMPower9TowerModelServerMP4.Focus();

            base.srStdDigitalResourceAccessWrapper(strThisPageURL, sender, "_Click", "*StandardResourceAccessFromTemp");

        }

 

        protected void lnkbtnPlayUnveilingTegratecsNewIBMPower9TowerModelServerMP4_Click(Object sender, EventArgs e)

        {

            base.srStdDigitalResourceAccessWrapper(strThisPageURL, sender, "_Click", "*StandardResourceAccessFromTemp");

        }

 

        protected void imgbtnPlayUnveilingTegratecsNewIBMPower9TowerModelServerMP4_Click(Object sender, ImageClickEventArgs e)

        {

            imgbtnPlayUnveilingTegratecsNewIBMPower9TowerModelServerMP4.Focus();

            base.srStdDigitalResourceAccessWrapper(strThisPageURL, sender, "_Click", "*StandardResourceAccessFromTemp");

        }

 

        // Take over for master page message box update panel

        // Find reference to the pnlMsgBox object

        // Record error acknowledgment/override within session variable based on error message text

        // Reset error highlighting

        protected void btnMsgBoxOKFromMasterPage(Object sender, EventArgs e, String strErrMsg)

        {

            clsFdnWebCS.stcAddToSsttEvnLog2(strThisPageURL, clsFdnWebCS.stcstrfctGetCtrlID(sender as Control) + "_Click", "85", ref base.strbldrEvtLogBase);

            System.Web.UI.Control ctrlControlObjRef = new Control();

            base.srGetControlObjectReference_FPStd("pnlMsgBox",

                this.Page as System.Web.UI.Control, ref ctrlControlObjRef);

            System.Web.UI.WebControls.Panel pnlID = new System.Web.UI.WebControls.Panel();

            pnlID = ctrlControlObjRef as System.Web.UI.WebControls.Panel;

            pnlID.Enabled = false;

            pnlID.Visible = false;

            // re-focus on button that originally triggered the error

            if (ViewState["vsv_strLastControlFocus"] != null)

            {

                System.Web.UI.Control webuictrlObject = new Control();

                base.srGetAnyWebUIControlObjRef_FPStd(ViewState["vsv_strLastControlFocus"].ToString(), ref webuictrlObject);

                webuictrlObject.Focus();

            }

 

        }

 

    }

 

}







Specifying the UI controls in the Content Page UI controls for the web page can be specified in XHTML and stored in the .aspx source file.  We are using the XHTML 5 Target Schema for Validation.


.aspx (view) source written
in XHTML

<%@ Page Language="C#" MasterPageFile="~/SiteLevelMasterPageCSv4.Master" AutoEventWireup="true"

       Inherits="nsTegratecsWSv10.AboutUs" Title="About Us"

       CodeBehind="AboutUs.aspx.cs" %>


<asp:Content id="HdgViaContentPortion" runat="server" contentplaceholderid="head">

</asp:Content>


<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">


    <div style="font-family: Arial; font-size:medium;">


    <br />

    <div style="text-align: center; width:80%; min-width:500px; max-width:800px; padding:5px;" class="centered_container_y_text">

        <br />

        <h2>Corporate Location</h2>


        <img src="images/common/1320%20Tower%20-%20NewResizedOptimized.jpg"

        alt="1320 Tower Road in Schaumburg, IL 60173"

        style="border-style: groove; border-width:3px; width:75%; min-width:325px; z-index:105;"/>


        <div class="centered_container_y_text" style="width:310px; text-align: center; font-size: smaller; vertical-align:top">

                   <strong>Tegratecs Development Corp.</strong>

                   <br />

                1320 Tower Road<br />

                   Schaumburg, IL 60173<br />

                800-739-3777<br />

        </div>


        <br />


        <p>

            Now with easy on and off access to Meacham Road in Schaumburg from the east via I90 (not yet shown on google

            map).&nbsp; Located down the street from IKEA Schaumburg...

        </p>


        <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d2962.351089082564!2d-88.04885108455328!3d42.05709337920836!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x880faf81515caf45%3A0x5844f73fc594b33f!2sTegratecs+Development+Corp.+%C2%AE!5e0!3m2!1sen!2sus!4v1547109551897" width="400" height="300" frameborder="0" style="border:0; margin-left:auto; margin-right:auto;" allowfullscreen></iframe>


        <br />

        <div class="centered_container_y_text">

            <h2>History</h2>

            <p class="centered_container_y_text" style="width:62%; min-width:225px;">

            Tegratecs Development Corp. was founded as an Illinois corporation based in Schaumburg, Illinois, starting

                operations in 1986.&nbsp; We have been at the 1320 Tower address since 1993.&nbsp;

            </p>

            <p>

            <img src="images/common/sparkler_girl_woman_happy_happiness-2807_free_from_pxhere.com.jpg"

            alt="A little celebration is in order!" title="A little celebration is in order!"

            style="border-style:solid; border-width:2px; width:250px; margin-left:auto; margin-right:auto; z-index:105" />

            </p>

            <p class="centered_container_y_text" style="width:78%; min-width:225px;">

                Another batch of Titleist Pro V1 golf balls celebrating our 30 years in business will be arriving soon!&nbsp; Get

                a sleeve just for evaluating one of our software products.&nbsp; 

            <p>

                We have been demonstrating our know-how in the areas of integrated business applications and concurrent

                multi-user solutions with relational database foundations for a long time...&nbsp; But the thrill

                isn&#39;t gone!&nbsp;<br />

                <br />

                And now

                we are a part of those delivering high end business applications via the browser.&nbsp; We love using OO

                programming to bring advanced business application logic to the zero footprint web browser in optimized

                formats such as mobile!&nbsp; <br />

            </p>


            <br />


            <div style="font-family:Arial; font-size:medium;" class="centered_container_y_text">

                <asp:Button ID="btnContactUs" runat="server" CssClass="WebButton" onclick="btnContactUs_Click" Text="Contact Us"/>

            </div>


            <p>

                Back to our original foundations for a moment...&nbsp; Our accounting software package, Financial Portrait

                           Software System, is now on Version 4 Build Set 9.&nbsp; Our largest customer in terms of company count on

                Version 4 is over 50 companies in one environment.&nbsp; Build Set 9 of Version 4 was released in Q3 of

                2018 and includes ePayments out of Accounts Payable.<br />

                <br />

                Some of our customers, as originally named, include

                American Hospital Supply, Baxter Healthcare, Central DuPage Hospital, Chicago Finished Metals, Children's

                Memorial Hospital, Culligan International, Inc., Hartz and Company, Inc., Interpoint Corporation,

                KW Control Systems, Levy Home Entertainment, Optyl, Parking Company of America, Rexam Release,

                Rosenbluth International, Inc., Roxane Laboratories, Inc., SuperValu Inc.and Western Folder Distributing Co...

            </p>


        </div>


        <br />

        <table id="tblControlButtons1" runat="server" class="centered_container_y_text">

            <tr>

                <td>

                    <asp:Button ID="btnCheckIn2" runat="server" CssClass="WebButton" Onclick="btnCheckIn2_Click" Text="Check In" />

                    <asp:Button ID="btnBack1" runat="server" CssClass="WebButton" OnClick="btnBack1_Click" Text="Go Back to Previous Page" />

                </td>

            </tr>

        </table>

       

        <br />

            <asp:Panel ID="Panel2" runat="server"  style="width: 78%; border-style: double;

                border-color:Black; border-width:medium; margin-left:auto; margin-right:auto">

                <br />

                <asp:LinkButton ID="lnkbtnPlay1320ConverenceRoomVideosMP4" runat="server" OnClick="lnkbtnPlay1320ConverenceRoomVideosMP4_Click">

                    Here is a short MP4 video of the conference, training and reception areas at

                    1320 Tower Road.</asp:LinkButton>

                <br />

                <asp:ImageButton ID="imgbtnPlay1320ConverenceRoomVideosMP4" runat="server"

                    ImageUrl="images/common/1320 Tower Conference and Training Rooms Video from Reception Area.jpg" width="258px"

                    OnClick="imgbtnPlay1320ConverenceRoomVideosMP4_Click"/>

            </asp:Panel>

        <br />


        <br />

            <asp:Panel ID="Panel13" runat="server"  style="width: 78%; border-style: double;

                border-color:Black; border-width:medium; margin-left:auto; margin-right:auto">

                <br />

                <br />

                <asp:ImageButton ID="imgbtnPlayUnboxingTegratecsNewIBMPower9TowerModelServerMP4" runat="server"

                    ImageUrl="images/common/Unboxing_Our_New_IBM_Power_9_server_at_1320_Tower_Road_First_Frame_260w.jpg" width="260px"

                    OnClick="imgbtnPlayUnboxingTegratecsNewIBMPower9TowerModelServerMP4_Click"/>

                <br />

                <br />

                <br />

            </asp:Panel>


        <br />

            <asp:Panel ID="Panel14" runat="server" class="centered_container_y_text" style="width:80%; min-width:485px; border-style: double;

                border-color:Black; border-width:medium;">

                <br />

                <asp:LinkButton ID="lnkbtnPlayUnboxingTegratecsNewIBMPower9TowerModelServerMP4" runat="server" OnClick="lnkbtnPlayUnboxingTegratecsNewIBMPower9TowerModelServerMP4_Click">

                    Watch - Unboxing Our New IBM Power 9 server at 1320 Tower Road</asp:LinkButton>

                <br />

                <br />

                <asp:LinkButton ID="lnkbtnPlayUnveilingTegratecsNewIBMPower9TowerModelServerMP4" runat="server" OnClick="lnkbtnPlayUnveilingTegratecsNewIBMPower9TowerModelServerMP4_Click">

                    Watch - Unveiling Our New IBM Power 9 S914 tower model</asp:LinkButton>

                <br />

                <br />

                <asp:ImageButton ID="imgbtnPlayUnveilingTegratecsNewIBMPower9TowerModelServerMP4" runat="server"

                    ImageUrl="images/common/Unveiling_Tegratecs_New_IBM_Power_9_Tower_Model_Server_4_Snippet_390w.jpg" width="390px"

                    OnClick="imgbtnPlayUnveilingTegratecsNewIBMPower9TowerModelServerMP4_Click"/>

                <br />

            </asp:Panel>

        <br />

        <div>

            <h2>Summary of Development Services</h2>

            <p>

            Tegratecs is a provider of innovative software and solutions for the changing needs of your growing SMB.&nbsp;

                Our success in delivering well-tuned and cost effective mult-user software is now extending to the web, and

                in many cases, can delivered within an incremental level of investment.&nbsp;

            </p>

            <p>

                Please explore our websites to find out about our latest software products, software development services and

                technology demonstrations!

            </p>

            <p>

                Our formula for sustaining user satisfaction, reducing maintenance costs and increasing ROI is to deliver

                designs that handle base requirements along with considerations for how the user and application will evolve.</p>

           

    </div>


    <br />

    <br />


    </div>


         <div style="font-family: Arial; font-size: 16pt; text-align:center; margin-left:auto; margin-right:auto">


               <table id="Table0" runat="server" style="text-align: left;  vertical-align:middle; width:325px;

                margin-left:auto; margin-right:auto; font:Arial; font-size:14pt; font-weight:bold; font-style:italic; color:#59438C "

                 cellpadding="0" >

                    <tr id="TableRow00" runat="server" style="border:none" >

                        <td id="TableCell000" runat="server" style="padding:1px;">

                            <asp:LinkButton ID="lnkbtnRegister" runat="server"

                            Font-Italic="True" onclick="lnkbtnRegister_Click">Check In<br />with Tegratecs!</asp:LinkButton>

                        </td>

                        <td id="TableCell001" runat="server" style="color:Black; font-weight:normal; padding:8px;">

                            &nbsp;or&nbsp;

                        </td>

                        <td id="TableCell002" runat="server" style="padding:8px;">

                            <asp:LinkButton ID="lnkbtnSignIn" runat="server" onclick="lnkbtnSignIn_Click"

                            ForeColor="#59438C" Font-Italic="True">Log In</asp:LinkButton>

                        </td>

                        <td id="TableCell003" runat="server" style="color:Black; font-weight:normal; padding:8px;">

                            for access to protected content...

                        </td>

                    </tr>

                    <tr id="TableRow01" runat="server" style="border:none; padding:3px;" >

                        <td id="TableCell010" runat="server" style="height:24px;">

                            <asp:LinkButton ID="lnkbtnUpdateMyContactInfo" runat="server" onclick="lnkbtnUpdateMyContactInfo_Click"

                            Font-Italic="True">Update My Account Information...</asp:LinkButton>

                        </td>

                    </tr>               

                </table>

               

                <br/>

                <br />


            </div>


</div>


</asp:Content>





        go to the home page     go to next series page Next in Articles     Site Map     Switch to
Mobile View

You are at the web site of Tegratecs Development Corp.  Click here to go to the home page of this site...
Innovative Solutions to Your Evolving Requirements
Our contact information:
Tegratecs Development Corp.
1320 Tower Road
Schaumburg, IL 60173
800-739-3777
( please register or sign-in )
© 2021 Tegratecs Development Corp.