• Search form is empty!

  • Enable Participation In ViewState When ReadOnly is True

    When ASP.NET controls are set to ReadOnly = true then they cannot participate in __ViewState.

    I have a control that I want to be readonly because another control will populate it.  Then, on postback, I want to extract the controls value.  To get at the controls value it must participate in __ViewState.

    The answer I found was to set ReadOnly = false, which is the default value, then set the control to readonly by adding a readonly Attribute on page load.

    In this example I have a TextBox control for holding a date value that is selected from the Ajax Toolkit’s CalendarExtender control.  I don’t want the user to type in the date because I don’t want to deal with validation.

    Here is the definition in markup of the TextBox, CalendarExtender, and ImageButton that is selected by the user.





    Here is the server side code for adding the readonly attribute.

    protected void Page_Load(object sender, EventArgs e)
    {
         if (!IsPostBack)
         {
              ToDate.Attributes.Add("readonly", "readonly");
         }
    }

    The Myth of “Good People”

    This is just an excellent blog from another blogger. 

    Rather than copy and paste
    it all here I'll give you an excerpt then a link to the full article.  In time I'll replace this with my own thoughts eventually but I want time to process...

    By Rich, June 21, 2010 10:36 am

    I often hear the phrase, “We hire the best and brightest.” It leaves me wondering who hires the “worst and dimmest.”

    In order to experience real success every team needs to determine how they can achieve extraordinary results with ordinary people. When I teach our Agile Explained class, I reference the six focus areas of Six Sigma. These include Environment, Measurement Systems, Methods, Materials, Machines, and People.

    My belief is most management teams first look at the people as the key to solving their most pressing problems.  “If we only had better people things wouldn't be this bad.”

    Don’t believe it. We have good people in our industry. The people in our industry are smart, dedicated, educated, and diligent. It’s not about the people."

    It takes 15 minutes to fully recover from conversational interruptions

    It takes 15 minutes to fully recover from conversational interruptions

    I’ve known about this study for about 6 years. When you are working, it takes 15 minutes to fully engage your mind into a single task. When you are interrupted, even for a moment, it takes 15 more minutes to be fully engaged again.

    So, 4 interruptions an hour can nearly cause zero productivity for that hour.

    Relationships matter, so this might not always be bad, but this is something to be aware of.

    A company I worked at used to have a policy called, “the cone of solitude”. This was a period of time where our phones are turned off, email is shut down, and we committed to not interrupting each other.

    I’m thinking about instituting this for myself at work for 2 hours a day. I think it will be a shock to my co-workers, because I'm as chatty as the next person, so I’ll go easy on them but I also believe it’s a good practice.



    “Error Creating Control” at Design Time

    “Error Creating Control” at Design Time

    This looks like a problem Microsoft might fix in VS2010 SP1.

    The problem is the designer is trying to access code that might not be available at design time like Session state.

    Here is an example of what might cause such a problem:

    protected override void OnInit(EventArgs e)
    {
         base.OnInit(e);
         this.wucGrade1.Cancel += new EventHandler(wucGrade_Cancel);
         this.wucGrade1.Ok += new EventHandler(wucGrade_Ok);
    }


    The solution is to check for the availability of Context and Context.Session before code is executed. 

    The designer will pass over the following code and your controls will render.

    protected override void OnInit(EventArgs e)
    {
         base.OnInit(e);
         if (Context != null && Context.Session != null)
         {

             this.wucGrade1.Cancel += new EventHandler(wucGrade_Cancel);
             this.wucGrade1.Ok += new EventHandler(wucGrade_Ok);
         }
    }


    I found this at: