For those of you who program mostly in code behind, like I do, I have a gotcha for a nested repeater addhandler.
The nested repeater is defined in the code in front:
<asp:Repeater ID="repTestKeyControl" runat="server">
Your nested repeater contains a button that needs to fire a click event, so you add a "CommandName."
<asp:Button ID="btnEdit" runat="server" Text="Edit" CommandName="cmdEdit" />
In the codebehind, you typically retrieve your nested repeater and add the handlers:
Dim repTestKeyControl As Repeater
repTestKeyControl = CType(e.Item.FindControl("repTestKeyControl"), Repeater)
AddHandler repTestKeyControl.ItemCommand, AddressOf repTestKeyControl_ItemCommand
AddHandler repTestKeyControl.ItemDataBound, AddressOf repTestKeyControl_ItemDataBound ' programmatically add the handler...
repTestKeyControl.DataBind() ' handlers must go before databind
You setup your ItemCommand:
Protected Sub repTestKeyControl_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.RepeaterCommandEventArgs)
If e.CommandName = "cmdEdit" Then
End If
End Sub
But it doesn't fire. Your ItemDataBound fires, so why not the ItemCommand?
I mean, typically a non-nested repeater uses this event and it triggers via the Handles modifier:
Protected Sub repTestKeyControl_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.RepeaterCommandEventArgs) Handles repTestKeyControl.ItemCommand
So why not a nested repeater? Well, I don't know why, but I know how to fix it. Add the handler in the code-in-front via the "OnItemCommand":
<asp:Repeater ID="repTestKeyControl" runat="server" OnItemCommand="repTestKeyControl_ItemCommand">
Now it works. Go figure. Hope that helps at least someone.
May your dreams be in ASP.NET!
Nannette Thacker
In this article, I want to show how you can setup your menus in code-behind and avoid redundancy. I recently inherited a web application with the menu system setup in the code-in-front. Each menu shared identical values, other than the visibility. Notice that numerous properties are defined more than once, above and below the MenuItems. What's as bad is that this entire block of code was repeated for 6 additional menus.
Example of Redundant, Bloated Menu Setup
<asp:Menu StaticMenuItemStyle-Font-Bold="true" Visible="true"
StaticMenuItemStyle-ForeColor="white"
StaticMenuStyle-HorizontalPadding="4"
StaticMenuItemStyle-Font-Names="verdana"
DynamicMenuItemStyle-Font-Names="verdana"
DynamicMenuItemStyle-Font-Size="Smaller"
StaticMenuItemStyle-Font-Size="Small" BorderColor="darkblue"
BorderWidth="1"
DynamicMenuItemStyle-BorderWidth="2"
DynamicMenuItemStyle-BorderColor="#CCCCCC"
DynamicHoverStyle-BackColor="wheat"
DynamicHoverStyle-ForeColor="black"
DynamicHoverStyle-Font-Bold="true"
DynamicMenuItemStyle-VerticalPadding="4"
DynamicMenuItemStyle-HorizontalPadding="4"
DynamicSelectedStyle-BorderStyle="None"
ID="Menu1" runat="server"
Font-Underline="False" Width="90px">
<Items>
<asp:MenuItem>...</asp:MenuItem>
</Items>
<StaticMenuItemStyle Font-Underline="False"
Font-Bold="True" Font-Names="verdana"
Font-Size="Small" ForeColor="White" />
<DynamicMenuStyle BackColor="#F2F8FF"
BorderColor="LightSkyBlue"
BorderStyle="Solid" BorderWidth="1px" />
<DynamicMenuItemStyle Font-Underline="False"
BorderColor="#CCCCCC" BorderWidth="2px"
Font-Names="verdana" Font-Size="Smaller"
HorizontalPadding="4px"
VerticalPadding="4px" />
<StaticMenuStyle HorizontalPadding="4px" />
<DynamicHoverStyle BackColor="Wheat"
Font-Bold="True" ForeColor="Black" />
<DynamicSelectedStyle BorderStyle="None" />
</asp:Menu>
If a property needs changed, the programmer must make certain that the change is made in all six instances of this block of code, for each menu, as well as realizing that certain properties are defined twice. This type of coding can introduce problems after updates and edits.
To optimize this menu, let's move this to the code-behind so that if a change is needed, it is only needed in one line of code. In our code-in-front, we'll simply setup the menus like so:
Streamlined Menu
<asp:Menu ID="Menu1" runat="server">
<Items>
<asp:MenuItem>...</asp:MenuItem>
</Items>
</asp:Menu>
<asp:Menu ID="Menu2" runat="server">
<Items>
<asp:MenuItem>...</asp:MenuItem>
</Items>
</asp:Menu>
...and so forth
In our codebehind, we'll setup each menu in our Page_Load and define one function that will set the properties for each menu:
Protected Sub Page_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles Me.Load
MenuSetup(Menu1, True)
MenuSetup(Menu2, True)
MenuSetup(Menu3, True)
MenuSetup(Menu4, False)
MenuSetup(Menu5, False)
MenuSetup(Menu6, False)
End Sub
Remember I said that the only difference in these menus was the visibility? So in our MenuSetup function we'll pass in the menu ID, as well as whether the menu should be visible or not. I've altered some of the values from what you see in the original code-in-front, but you get the idea. Be sure to import System.Drawing for the colors.
Protected Sub MenuSetup(ByVal myMenu As Menu, _
ByVal visibility As Boolean)
myMenu.Visible = visibility
myMenu.BorderColor = Drawing.Color.Black
myMenu.BorderWidth = Unit.Pixel(1)
myMenu.Font.Underline = False
myMenu.Width = Unit.Pixel(90)
myMenu.StaticMenuStyle.HorizontalPadding = Unit.Pixel(4)
myMenu.StaticMenuItemStyle.Font.Bold = True
myMenu.StaticMenuItemStyle.Font.Name = "Verdana"
myMenu.StaticMenuItemStyle.Font.Size = "10"
myMenu.StaticMenuItemStyle.Font.Underline = False
myMenu.StaticMenuItemStyle.ForeColor = Color.White
myMenu.DynamicMenuStyle.BorderWidth = Unit.Pixel(1)
myMenu.DynamicMenuItemStyle.Font.Bold = True
myMenu.DynamicMenuItemStyle.Font.Name = "Verdana"
myMenu.DynamicMenuItemStyle.Font.Size = "8"
myMenu.DynamicMenuItemStyle.BorderWidth = Unit.Pixel(1)
myMenu.DynamicMenuItemStyle.BorderColor = _
ColorTranslator.FromHtml("#CCCCCC")
myMenu.DynamicMenuItemStyle.BorderStyle = BorderStyle.None
myMenu.DynamicMenuItemStyle.VerticalPadding = Unit.Pixel(4)
myMenu.DynamicMenuItemStyle.HorizontalPadding = Unit.Pixel(4)
myMenu.DynamicMenuItemStyle.ForeColor = Color.Black
myMenu.DynamicMenuItemStyle.BackColor = _
ColorTranslator.FromHtml("#F0F2F4")
myMenu.DynamicHoverStyle.BackColor = _
ColorTranslator.FromHtml("#CCCCCC")
myMenu.DynamicHoverStyle.ForeColor = _
ColorTranslator.FromHtml("#00008B")
myMenu.DynamicSelectedStyle.ForeColor = _
ColorTranslator.FromHtml("#00008B")
End Sub
Notice some of the differences when defining properties in the code-behind:
| Front |
Behind Imports System.Drawing ' for Colors |
| Width="90px" |
myMenu.Width = Unit.Pixel(90) |
| StaticMenuItemStyle-Font-Bold="true" |
myMenu.StaticMenuItemStyle.Font.Bold = True |
| Visible="true" |
myMenu.Visible = visibility |
| StaticMenuStyle-HorizontalPadding="4" |
myMenu.StaticMenuStyle.HorizontalPadding = Unit.Pixel(4) |
| StaticMenuItemStyle-Font-Names="verdana" |
myMenu.StaticMenuItemStyle.Font.Name = "Verdana" (singular .Name for one) |
| StaticMenuItemStyle-Font-Size="Small" |
myMenu.StaticMenuItemStyle.Font.Size = "10" |
| DynamicMenuItemStyle-BorderWidth="2" |
myMenu.DynamicMenuItemStyle.BorderWidth = Unit.Pixel(2) |
| DynamicMenuItemStyle-BorderColor="#CCCCCC" |
myMenu.DynamicMenuItemStyle.BorderColor = ColorTranslator.FromHtml("#CCCCCC") |
| DynamicHoverStyle-BackColor="wheat" |
myMenu.DynamicMenuItemStyle.BackColor = Color.Wheat |
| DynamicHoverStyle-Font-Bold="true" |
myMenu.DynamicHoverStyle.Font.Bold = True |
| DynamicSelectedStyle-BorderStyle="None" |
myMenu.DynamicSelectedStyle.BorderStyle = BorderStyle.None |
May your dreams be in ASP.NET!
Nannette Thacker
View State allows you to retain page property values, such as string and numeric types, between postbacks. You may also store class objects in View State, but you must first add the Serializable attribute. If you do not add the Serializable attribute, you will receive this error when trying to add the object to View State:
Type 'SuchAndSuch.ThisAndThat' in Assembly 'SuchAndSuch, Version 1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.
Here is an example of adding Serializable to a class:
<Serializable()>_
Public Class aMenu
Public MenuName As String
Public MenuId as Integer
Public Url as String
Public Sub New(ByVal menuName as String, ByVal menuId as Integer, ByVal url as String)
MenuName = menuName
MenuId = menuId
Url = url
End Sub
End Class
The aMenu class can now be added to View State:
Dim myMenu as New aMenu("Home",1,"/default.aspx")
ViewState("myMenu") = myMenu
To use the aMenu object:
If ViewState("myMenu") IsNot Nothing then
Dim myMenu as aMenu
myMenu = DirectCast(ViewState("myMenu"),aMenu)
End If
May your dreams be in ASP.NET!
Nannette Thacker
Ash explains the concept of Filtering Parameters in a Stored Procedure in this blog post.
This method is safer and more beneficial than dynamically creating and passing a sql query from the code layer and using sp_executesql, as it helps to avoid sql injection attacks.
However, the author explains there is a pitfall because you may sacrifice index optimization.
Check it out!
May your dreams be in ASP.NET and your code free from sql injections!
Nannette Thacker
Nathan Barry posted a new article on How To Use Icons To Support Content In Web Design.
Besides his design insights, he also provides images that depict actual live website examples and links to those sites.
His tips include How to Use Icons, Purpose and Placement, Icon Styles, and numerous examples.
Check it out!
May your dreams be in ASP.NET!
Nannette
I have been using Telerik controls for about a year now. First, on a client site project, and then I licensed it for my own development needs as a consultant.
I have to say I am tickled with the Telerik support.
1) Telerik forums are great. Ask a question, get a quick answer from Telerik staff and users. Yes, the Telerik staff actually responds in the forums. You would not believe the number of forums I've posted to where the people/product supporting the forum do not participate. Talk about trying to get out of doing your job by making others do your work for you for free. Those types of forums typically do not get an answer at all!
2) Telerik support. Wow. They're on a completely different time zone, so it's expected I do have to wait 24 hours to get a response. But when the response arrives, wow. And why do I say wow? Well, there are numerous times I ask a question, and then the response says, "Here, try this zip project." I open up the project, and it's an exact project with my exact question and answer right there. They created it just for me, with my tables, fields, data, and everything! Wow!
The other day, I saw a cool menu on a website. I wrote and asked, "Can your menu do this?" They sent me a zip project with their menu doing exactly what that one did. And it did it better!
Yesterday, I wrote and asked how to populate a treeview with two tables as parent/child. I have done this before, but I had done it by putting the table in a generic list and manually building the tree. Today, at 3:27 am, they sent me a zipped file with my exact scenario, tables and all, showing me how to populate this tree with two tables. Much simpler than what I was going to do. This wasn't a little zip file they keep on hand and send out to everyone. It was customized with my exact solution!
Wow. And they've done this in the past. I've turned in more than 50 support requests and I always get great responses.
So yeah, with all the cruddy support out there, I just wanted to take a moment and thank Telerik and tell you about their wonderful support.
May your dreams be in ASP.NET and your controls be Rad!
Nannette Thacker
If you're a VB.NET developer learning C# or converting your VB code to C#, here are a few hints, tips and gotchas.
But first, let me share a few important links with you:
VB.NET and C# Comparison - This is one of the most accurate and complete charts I've seen comparing VB.NET with its C# equivalent.
Convert VB.NET to C# and Convert C# to VB.NET - developerFusion provides these free online utilities to automatically convert VB.NET to C# and C# to VB.NET. It also supports the .NET 3.5 framework. There is no download required. Just simply use the online form. Telerik also provides a utility to Convert VB to C# or C# to VB. However, Linq is not yet supported in either converter as of this writing.
LearnVisualStudio.net provides free Cheat Sheets for "C# Language Basics Cheat Sheet" and "Visual Basic Language Basics Cheat Sheet." The links to the zip files can be found at the bottom of the home page.
I'll admit I've only been working with C# since 2007 and the majority of my projects have been in VB.NET. But I finally decided to write this post on some of the gotchas I have found when working with C# versus VB.
Option Strict On
By default, VB.NET sets Option Strict Off which allows backward compatibility with older Visual Basic legacy code. C# was originally written with the same type checking functionality as is performed in VB with Option Strict On. Therefore when converting your VB to C#, there is no option for Option Strict On.
For further information on OPTION STRICT ON in VB.NET, please see this article by Michael McIntyre.
References and Namespace Gotchas
C# is a lot more picky about referencing namespaces. For instance, in VB.NET you can access the Drawing.Colors like so without including the namespace:
validator.ForeColor = Drawing.Color.BlueViolet
However, in C#, even if you include the System namespace:
using System;
you cannot access a Drawing.Color member like so:
validator.ForeColor = Drawing.Color.BlueViolet;
you must use:
using System.Drawing;
and access the colors this way:
validator.ForeColor = Color.BlueViolet;
So even though you are "using System;" you would expect that you could use the Drawing namespace by calling Drawing.Color.BlueViolet as you can in VB. But it seems C# requires the namespace be added in a using directive and then you can call the class and its members. If any C# gurus have any further comments or links to shed more light on this, I'd appreciate it.
With Construct
There is no With construct in C#:
VB:
With validator
.ForeColor = Drawing.Color.BlueViolet;
End With
C#:
validator.ForeColor = Color.BlueViolet;
CInt versus (int) versus Convert.ToInt32
In VB.NET you can use CInt() for data type conversions:
If CInt(myString) <> NUMERICCONSTANT Then
Of course this will also work:
If (Convert.ToInt32(myString) <> NUMERICCONSTANT ) Then
However, in C#, this will error:
if ((int)myString != NUMERICCONSTANT)
But this will work:
if (myString != Convert.ToString(NUMERICCONSTANT))
See this article for a great comparison of String to Integer Conversion Methods in VB.NET.
Microsoft.VisualBasic Namespace
There are a few functions that are not available in C#. However, you can accomplish this same functionality in C# by including the Microsoft.VisualBasic Namespace. In your C# project, add a Reference to the Microsoft.VisualBasic component. Then add this directive to your class:
using Microsoft.VisualBasic;
Now you can produce the equivalent of this VB code:
If IsNumeric(myString) Then
in C#:
if (Information.IsNumeric(myString)) {
Also, this VB:
Microsoft.VisualBasic.Chr(9)
Can now be used in C# as:
Strings.Chr(9)
Other examples using Left and Len:
VB:
clientPath = Left(validFile.FileName, Len(validFile.FileName) - Len(validFile.GetName()))
C#:
clientPath = Strings.Left(validFile.FileName, Strings.Len(validFile.FileName) -
Strings.Len(validFile.GetName()));
DateTime can't be Declared as a Constant in C#
In C#, a Date cannot be declared as a constant.
VB:
Public Const INVALIDDATE As Date = #1/1/1753#
However, in C#, you may reproduce the same functionality by using either of these:
C#:
public readonly DateTime INVALIDDATE = DateTime.Parse("01/01/1753");
or
public static readonly DateTime INVALIDDATE = Convert.ToDateTime("01/01/1753");
() and Method Calls
In VB you can get away with calling a method call without ()'s. However, C# requires () after method calls.
For instance, this will work in VB:
control.GetType
But in C#, you must have the parens:
control.GetType()
Enumeration Conversions
In VB if you want to retrieve the numeric value of an enumerator, by default the enumerator returns the numeric value:
Enum Layout
Green = 1
Blue = 2
End Enum
Layout.Green will return 1.
Layout.Green.ToString() will return "Green"
C# does the opposite.
Layout.Green will return "Green"
To retrieve the numeric value, you must convert it to a numeric value first:
Convert.ToInt32(Layout.Green)
or:
(int) Layout.Green
In VB if you wish to retrieve the string equivalent of the numeric value, you must first convert the enumerator to an int, then convert the returned value to a string. You might do it this way, which won't work in C#:
CInt(Layout.Green).ToString
But in C#, the equivalent is:
Convert.ToString(Convert.ToInt32(Layout.Green))
Select / Case versus Switch / Case and Constants
In C#, the Switch/Case requires constants, so forget using the Switch / Case with your enumerator comparisons.
In VB, you can do this:
Select Case layoutName
Case Layout.Green.ToString
Return CInt(Layout.Green)
End Select
But in C#, the converters will convert it to this, which is not supported and will error:
switch (layoutName) {
case Layout.Green.ToString:
return (int)Layout.Green;
}
Instead, you'll need to convert your switch statement to an if/else statement:
if (layoutName == Convert.ToString(Layout.Green))
return Convert.ToInt32(Layout.Green);
So in C#, only constants will work, such as:
case 25:
or
case "male":
... et cetera.
CStr versus (string)
VB:
If CStr(myID) <> "25" Then
C#:
if ((string)myID != "25")
Linebreaks with Microsoft.VisualBasic.Chr(13) versus Environment.NewLine
If you have been using Microsoft.VisualBasic.Chr(13) to achieve a line break when creating javascript blocks, for instance, this will not work in C# unless you create a reference to the Microsoft.VisualBasic component and change it to Strings.Chr(13).
However, for both VB and C# you can achieve the same effect by using Environment.NewLine.
Global Constants
In VB, you can create Global Constants using a Public Module and call the constant directly by name if you include the namespace. In C#, you must include the class name when using the constant.
For instance, in VB, you can create a public module:
Public Module MyConstants
Public Const SUCCESS As Integer = 1
End Module
Then throughout your application you can use SUCCESS in any class as a global constant.
In C#, you must define a public static class:
public static class MyConstants
{
public const int SUCCESS = 1;
}
And when using the constant, preface it with the class name:
MyConstants.SUCCESS
VB:
Return (value <> SUCCESS)
C#:
return (value != MyConstants.SUCCESS);
Keywords
When using the code converters, sql keywords will be prefaced with @ in C#. For instance the "from" key word:
VB:
byval from as string
C#:
string @from
I would suggest changing variable names to non-keywords, such as:
string fromname
Web.UI.Control
In VB you can have this:
Dim myControl As Web.UI.Control = control.Parent
In C# the equivalent is:
Control myControl = control.Parent;
If you have any further comments to share, please do.
Educate Me! And may your dreams be in ASP.NET!
Nannette Thacker
Since I had purchased the SQL Server 2008 Web Edition for my database server, I decided to also install it on my development box. But when I tried to install the Management Tools, it errored with:
"Previous release of Microsoft Visual Studio 2008."
I click the "failed" link and it complained...
"Upgrade MS Visual Studio 2008 to the SP1 before installing sql server 2008."
I researched this error and was told this occurs if you had a previous beta version of Visual Studio 2008 and that you also needed SP1. Well, I had never used a beta version of VS2008 and I had SP1 installed, so that couldn't be the problem.
So I uninstalled the SQL Server 2005 Express Edition that came with my Visual Studio 2008.
I then installed SQL Server 2008 Web Edition and all was well... yay! One problem fixed.
Fixed until I needed to create an express MDF database or work with an existing one. So I installed the SQL Server 2008 Express Edition database and when I clicked the App_Data directory to add a new SQL Server database, I received the error:
"failed to generate a user instance of sql server due to a failure in starting the process"
Googling the phrase (and don't you love Google's intellisense in their search box that finishes your typing for you?!) brings up 15,200 results, with many, many potential solutions. Even the potential solutions have more potential solutions in the user comments. "I did this..." but "that didn't work for me, so I did this..." and so on.
So I decided to hopefully restrict it to the 2008 version by adding 2008 to the front of the error message. Fortunately, I landed on this blog post first:
Errror Message : Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance
The author, (and why is it so hard to find author's names on their blogs!!!), says to delete this directory:
1) C:\Documents and Settings\username\Local Settings\Application Data\Microsoft\Microsoft SQL Server Data\SQLEXPRESS
2) and reboot your computer.
Did it work for me? Yes!
I hope sharing this find with you is helpful. I muddled through a lot of "solutions...." some that were pages long, involved permissions, authorities, command line changes, and who knows what else. I didn't try any of them. I wanted to try something simple first. This was very simple and voila!
May your dreams be in ASP.NET and your SQL Servers run smoothly!
Nannette Thacker
I'm going to demonstrate how to add javascript events programmatically in codebehind using the Attributes.Add method. You may want to add your javascript attributes programmatically so that you can populate the values from a database.
For demonstration purposes, I'm going to add javascript click events to an image. Let's start out with this cute little script contributed by Paul Kurenkunnas that I found on Javascript.Internet.Com (click to see it in action), which enlarges and reduces an image size on click and double-click. This javascript is simple enough that anyone can use it to see Attributes.Add in action.
<img src="waterfall.jpg" width="150" height="200" onclick="this.src='waterfall.jpg';this.height=400;this.width=300" ondblclick="this.src='waterfall.jpg';this.height=200;this.width=150">
Next in our code in front, we place an image control:
<asp:Image ID="Image1" runat="server" />
In the codebehind, we want to programmatically setup everything else. Notice I hard-code in the dimensions and URL, but you could easily retrieve the values from a database table and use them instead. This demo is primarily for the purpose of showing how to use the Attributes.Add and ResolveClientUrl methods:
VB.net:
Image1.ImageUrl = "~/site/images/MyImage.jpg"
Dim imageSrc As String = ResolveClientUrl(Image1.ImageUrl)
Image1.Attributes.Add("onclick", "this.src='" & _
imageSrc & "';this.height=600;this.width=400")
Image1.Attributes.Add("ondblclick", "this.src='" & _
imageSrc & "';this.height=300;this.width=200")
C#:
Image1.ImageUrl = "~/site/images/MyImage.jpg";
string imageSrc = ResolveClientUrl(Image1.ImageUrl);
Image1.Attributes.Add("onclick", "this.src='" + imageSrc +
"';this.height=600;this.width=400");
Image1.Attributes.Add("ondblclick", "this.src='" + imageSrc +
"';this.height=300;this.width=200");
The code generated within the browser is:
<img id="ctl00_MainBody_Image1"
onclick="this.src='../../../site/images/MyImage.jpg';
this.height=600;this.width=400"
ondblclick="this.src='../../../site/images/MyImage.jpg';
this.height=300;this.width=200"
src="../../../site/images/MyImage.jpg" style="border-width:0px;" /><br />
Notice the image path was originally setup with:
"~/site/images/MyImage.jpg"
We must use the ResolveClientUrl method to obtain a URL that can be used by the browser:
../../../site/images/MyImage.jpg
Just FYI, don't put a height and width for the image or the resizing won't work.
The Attributes.Add method can be added to numerous controls, such as images, buttons, comboboxes, labels, textboxes, radio buttons, checkboxes and more.
May your dreams be in ASP.NET!
Nannette
Employers should encourage programmers to exercise and be fit, as a recent study found that those who are fit have four times less brain shrinkage than those who aren't. And seriously, that can only help you be a better programmer, right?
A recent Reader's Digest blurb in the Health section tells of an Alzheimer's study.
"A University of Kansas study found that patients who were fit had four times less brain shrinkage (meaning cell death) than those who were out of shape. The benefits of exercise, including changes in growth factors and increased blood vessels and blood flow, may prevent brain cells from dying. Researchers suggest first-time exercisers begin with a 15- to 30- minute walk three times a week." - Reader's Digest pg. 96, December 2008.
Okay, so I stretched it a bit. But yes, I believe in being fit, and I believe in the advantages of proper diet and exercise. Personally, I feel this can be related to everyone's brain and general health.
I think companies should encourage programmers to get outside at least once a day for a 10-15 minute walk. It would clear up the cricks in the necks, allow the mind to relax, and some of those tough problems might even get resolved while walking.
We're told we should take a break from monitors every few hours, to avoid eye strain, so why not take a walk. The cigarette and coffee breaks don't count. And seriously, if management allows all the cigarette and coffee breaks, why don't they encourage exercise breaks? I think the trouble is peer pressure. No one wants to go outside and have people accuse us of goofing off. If management would encourage it, wouldn't that be great!
What do you think?
3 John 1:2 Beloved, I wish above all things that thou mayest prosper and be in health, even as thy soul prospereth.
May your dreams be in ASP.NET and may your Health be Excellent!
Nannette
More Posts
Next page »