RSS

Category Archives: Uncategorized

Understanding Previous Co-Workers After You have Left

So today I had an unusual email wait let me start from the beginning. I was at a company for some time and left for a new opportunity I worked with another developer to co-develop two websites with the same supporting back ends. Though we had our differences I always thought we were good associates. At my new place of work I came across a problem and remembered an open source tool that I couldn’t remember the name of so I emailed this previous co-worker wondering if he remembered the name for it and here is the message chain with names redacted and any personally identifiable information:

I just wanted the name of the public library not anything developed by Acme. Thanks for the answer though.

Alex Seabrooks

Senior Application developer *

Phone:  *

Location: *     

From: * [*]
Sent: Tuesday, September 24, 2013 1:58 PM
To: Seabrooks, Alex
Subject: RE: Hi *

Hello Alex,

Sorry, but I did not receive permission to divulge any Acme IP nor the sources used to develop Acme IP.

*name*

From: Seabrooks, Alex [*]
Sent: Monday, September 23, 2013 10:23 AM
To: ******
Subject: Hi *

Hi *****, how have you been? Had a question for you hope you don’t mind me asking you hopefully this email finds you well. A while back we implemented a message pane on the accounts search page that let you know that your last action was successful and you got the library from Google. I have tried finding it and can’t. Do you happen to remember the library address? Working on a similar issue here and would love to find it.

Alex Seabrooks

Senior Application Developer- *

Phone:  *

Location: *     

So I am confused by this but alright this comes down to where you thought you stood and where you stand with previous co-workers.Now asking the name of an open source library to me did not sound like a big deal but from what I can gather he regards it as one or maybe we did not stand where I thought we did when I left. Either way interacting with previous co-workers can sometimes uncover issues you were unaware of and maybe that’s a good thing. I personally wanted to talk about the approach I take as I would have differed in my actions 

Now contracts are a big thing both NDA’s and non-competes, make sure in your contract you are free and clear. NDA means you won’t disclose source code or the like that belongs to your company and sometimes more. So regard your personal agreements first as these override any opinion I have and this is not legal advice. Now with that out of the way, I have some rules in interacting with people I used to work with. My rule of thumb is to be cordial and helpful as the people you work with may work with you again. Nothing creates issues like someone you used to work with coming on board and there being pre-existing issues. This creates unneeded cohesion and work issues. Be nice to previous co-workers who contact you with a minor contact question or the like. Most likely they regard you in a friendly manner. If it’s nothing violating your contracts with said previous company why not help them out. John not remembering that jQuery Validation was the library you used for validation is not a big deal in my opinion and I would gladly help as it is an open source library that was not property of the company we worked for and does not disclose any specific design implementations (I.E. code). But let me get your opinion on this how do you feel should you brick wall or be cordial? Inbox me and I will approve your messages as I receive them as usual.

 

 
Leave a comment

Posted by on September 24, 2013 in Uncategorized

 

How to add Controls Dynamically and Have Them Persist Through Postback

So the need arises and you need to add controls on demand in my case it is so that a user can add multiple accounts to pay by clicking a button. Here is how to do it.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page
{
    private const int controlCount = 1;

    protected void Page_Init(object sender, EventArgs e)
    {
        
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (Page.IsPostBack)
        {
            foreach (HtmlGenericControl item in MyControlState)
            {
                PlaceHolder1.Controls.Add(item);
            }
        }
    }

    private int _CurrentControlcount
    { 
        get
        {
            int _currentControlcount = object.Equals(Session["_currentControlcount"], null) ? controlCount : (int)Session["_currentControlcount"];
            if (Object.Equals(_currentControlcount, null))
            {
                _currentControlcount = new int();
                _currentControlcount = 0;
                Session["_currentControlcount"] = _currentControlcount;
                
            }
            return _currentControlcount;
        }        
        set
        {
             Session["_currentControlcount"] = value;
        }
    }

    private List<HtmlGenericControl> MyControlState
    {
        get
        {
            List<HtmlGenericControl> myControlState = (List<HtmlGenericControl>)Session["myControlState"];
            if (object.Equals(myControlState,null))
            {
                myControlState = new List<HtmlGenericControl>();
            }

            return myControlState;
        }
        set
        {
            Session["myControlState"] = value;
        }
        
    }

    protected void btnAddControls_Click(object sender, EventArgs e)
    {
        int count = MyControlState.Count();
        HtmlGenericControl myGenericUL = new HtmlGenericControl("ul");
        HtmlGenericControl myGenericLI = new HtmlGenericControl("li");
        TextBox tbx = new TextBox() { Text = string.Format("Textbox{0}", count), ID = string.Format("Textbox{0}", count) };
        myGenericLI.Controls.Add(tbx);
        myGenericUL.Controls.Add(myGenericLI);
        PlaceHolder1.Controls.Add(myGenericUL);
        List<HtmlGenericControl> setup = MyControlState;
        setup.Add(myGenericUL);
        MyControlState = setup;
        _CurrentControlcount = _CurrentControlcount + 1;
    }

}

and the html

<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!-- use the default masterpage from microsoft or whatever you like -->
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        Welcome to ASP.NET!
    </h2>
    <p>
        To learn more about ASP.NET visit <a href="http://www.asp.net" title="ASP.NET Website">www.asp.net</a>.
    </p>
    <p>
        You can also find <a href="http://go.microsoft.com/fwlink/?LinkID=152368&amp;clcid=0x409"
            title="MSDN ASP.NET Docs">documentation on ASP.NET at MSDN</a>.
    </p>
    
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true"></asp:ScriptManager>
    <asp:PlaceHolder ID="PlaceHolder1" runat="server" >

    </asp:PlaceHolder>
    <br />
    <asp:Button ID="btnAddControls" runat="server" Text="Add Control" 
        onclick="btnAddControls_Click" />

</asp:Content>

now I know that the code is rough and I am touching it up as we speak i really meant to hit draft not publish but it will be ok

 
Leave a comment

Posted by on May 20, 2013 in Uncategorized

 

Example of Why You Shouldn’t Use Hungarian Notation

So today had to go into a project and make a small change from a regular textbox to a Masked Numeric TextBox the control was for Phone Numbers to be used for a contacts object that is gotten and updated throughout the session and used in multiple other places in the web site. problem was is that the hungarian annotation had to be changed through out. Anywhere the object or session object was referenced. Also it was being placed into a local object in other places, so find and replace did not work for all those who were about to shout it. example:

TextBox alter_tbxPhoneNumber = (TextBox)Session["tbxPhoneNumber"];

This broke because the object was no longer a TextBox and therefore you can’t cast it to a TextBox nor can you place it into a TextBox object. If you’re a developer and you can’t mouse over a variable name to see what type it is or simply use getType then object orientation isn’t for you in the first place. Just my opinion though. Till next time don’t let your code have a meltdown.

 
2 Comments

Posted by on March 16, 2012 in Uncategorized

 

The Begining

Today is the day I start my blog I will be introducing 2 intro level concepts for Jr. Devs and 1  advanced concept for more polished pro’s to look at. also providing links to any associated you tube video’s.

 
Leave a comment

Posted by on October 27, 2011 in Uncategorized