What cause failure in a project from my point of view are a couple of small basic Issues.

  1. Sufficient Information.
  2. Leadership
  3. Talent

I know it seems like I’m over simplifying things, but I’m about the general case why projects tend to fail. Not because the company got sold, or one day you your systems collapse the day before ship or anything short of divine intervention.

1. Sufficient Information:

Providing proper documentation about the project is essential to the success, a lot of people are of the notion that the developer doesn’t need to everything about a project. While they don’t need to know everything it would be nice to know most of it. This means that the Analyst or PM must provide all work flows of how a user’s will be accessing and using the application. so that there are know gotcha’s in the end. I do not place most the blame on the Analyst or PM because the user might not at the time tell them everything. But that is there job… to quote Billy Hollis ” this is where prototyping with a rapid feedback loops is essential.”

2. Leadership:

There needs a to be a person providing the direction technical or non-technical direction, but someone with a vision of some sort. This is so that the project feels more than just that, making the people involved as part of something greater; giving them a sense of ownership in what there doing.

3. Talent:

There needs to be a person that pushes the envelope and set the bar. There something to be said about people who truly love what there doing, if you project is full of people that just want to be there 8 to 5 and just get there task done…well you gonna put out something that reflect 8 to 5 and just works, and feels like any other application.

.

I know i been away but here is part three, this version checks your Asp_net role and the roles for a current node. Veri simple but the menu looks very cool

[code lang=”csharp”]
[Serializable()]
public class CssMenu : Panel
{
private SiteMapDataSource xds;
private string[] userRoles;

private bool HasRoles(SiteMapNode item)
{

bool retval = false;
foreach (string item2 in item.Roles)
{
if (item2.ToString().Equals(“*”))
retval = true;
foreach (string item1 in userRoles)
{
if (item1.Equals(item2.ToString()))
retval = true;
}
}
return retval;
}

public SiteMapDataSource DataSource
{
get
{
return xds;
}

set
{
xds = value;
}
}
///
///
///
public string CssId
{
get
{
if (ViewState[“CssId”] == null)
ViewState[“CssId”] = “”;
return (string)ViewState[“CssId”];
}
set
{
ViewState[“CssId”] = value;
}
}
///
///
///
public bool StartAtRoot
{
get
{
if (ViewState[“StartAtRoot”] == null)
return false;
return (bool)ViewState[“StartAtRoot”];
}
set
{
ViewState[“StartAtRoot”] = value;
}
}
///
///
///
public string CssCurrentClass
{
get
{
if (ViewState[“CssCurrentClass”] == null)
ViewState[“CssCurrentClass”] = “”;

return (string)ViewState[“CssCurrentClass”];
}
set
{
ViewState[“CssCurrentClass”] = value;
}
}
///
///
///
public int ChildLevels
{
get
{
if (ViewState[“ChildLevels”] == null)
ViewState[“ChildLevels”] = 1;

return (int)ViewState[“ChildLevels”];
}
set
{
ViewState[“ChildLevels”] = value;
}
}
///
///
///
private void LoaChildsNodes(SiteMapNodeCollection smnc, ref Panel obj)
{
Literal lit = new Literal();
lit.Text = ” “;
obj.Controls.Add(lit);
foreach (SiteMapNode item in smnc)
{
//if (this.HasRoles(item.Roles))
// {
lit = new Literal();
lit.Text = “* “;
obj.Controls.Add(lit);
HyperLink lnk = new HyperLink();
lnk.Text = item.Title;
lnk.NavigateUrl = item.Url;
if (Page.Request.RawUrl.ToLower().Contains(item.Url.ToLower()) && (CssCurrentClass.Length > 0))
lnk.CssClass = CssCurrentClass;
else
lnk.CssClass = “”;
obj.Controls.Add(lnk);
lit = new Literal();
lit.Text = ” “;
obj.Controls.Add(lit);
// }

}
lit = new Literal();
lit.Text = “”;
obj.Controls.Add(lit);
}
protected override void OnDataBinding(EventArgs e)
{
base.Controls.Clear();
base.OnDataBinding(e);
SiteMapNodeCollection smnc;
userRoles = Roles.GetRolesForUser();
xds = this.DataSource;
if (StartAtRoot)
smnc = xds.Provider.GetChildNodes(xds.Provider.RootNode);
else
smnc = xds.Provider.GetChildNodes(xds.Provider.CurrentNode);

Literal lit = new Literal();
lit.Text = “”;
base.Controls.Add(lit);

foreach (SiteMapNode item in smnc)
{
if (HasRoles(item))
{
lit = new Literal();
lit.Text = ” * “;
base.Controls.Add(lit);
HyperLink lnk = new HyperLink();
lnk.Text = item.Title;
lnk.NavigateUrl = item.Url;
if (Page.Request.RawUrl.ToLower().Contains(item.Url.ToLower()) && (CssCurrentClass.Length > 0))
{
lnk.CssClass = CssCurrentClass;
}
else
{
lnk.CssClass = “”;
}
base.Controls.Add(lnk);
SiteMapNodeCollection smc2 = xds.Provider.GetChildNodes(item);
if ((this.ChildLevels > 1) && (smc2.Count > 0))
{

Panel pn = new Panel();
lit = new Literal();
lit.Text = “”;
pn.Controls.Add(lit);
this.LoaChildsNodes(xds.Provider.GetChildNodes(item), ref pn);
lit = new Literal();
lit.Text = “”;
pn.Controls.Add(lit);
base.Controls.Add(pn);
}
lit = new Literal();
lit.Text = “”;
base.Controls.Add(lit);
}
}
lit = new Literal();
lit.Text = “”;
base.Controls.Add(lit);

}

}
[/code]

I didn’t post any css in my previous post for the use of the menu control this is the css i used when i was creating it. The Menu Id is a horizontal menu and Nav Id is a vertical menu, as you can see all i have to do is assign the CssId to the control and we manage the look with css and the content in code.

My next post will be about using the Roles to determine access to the user.

Sample CSS:
[code lang=”css”]
/**** Main Menu ***/

#menu {
display: block;
float:right;
}

#menu ul {
margin: 0;
list-style: none;
}

#menu li {
display: block;
float: left;
white-space: nowrap;
}

#menu li a {
display: block;
padding: 55px 20px 12px 20px;
text-decoration: none;
color: #fff;
font-weight: bold;
}

* html #menu a {width:1%;}

#menu li a:hover {
background: url(../img/bg_menu.gif);
}

#menu li a.current {
letter-spacing: 1px;
color: gray;
background: url(../img/bg_menu.gif);
}

#menu li a.current:hover {
color: #fff;
}

/**** nav ***/
#nav{ list-style: none; margin: 2.0em 0; width: 25em; float: right;}
#nav li{ padding: 0; margin: 0; }
#nav a{
display: block;
height: 2.0em;
padding: 0.3em 0.3em 0.3em 0.8em;
border-bottom: 2px; /*solid #1a1a1a*/
border-top: 2px; /*solid #1a1a1a*/
color: #93B300;
background-color: #F7F9FB;
font-weight: bold;
text-decoration: none;
}

#nav a:hover{
color: #1a1a1a;
background: url(../img/bg_t.gif) no-repeat;
background-color: #fff;
font-weight: bold;
}
[/code]