R
Ron
I re posted beacause I copied and pasted my code incorrectly that it
probably needed a re start with the correct code. I also striped out the
Clone() stuff because that really had no bearing on the problem Im haveing.
My goal is to overwrite the Group object in the collection with the one that
is passed in the method. For some reaseon it doesnt overrite it. But I
tested by just assiging the 'Name' property instead of overwriting he entire
object and it worked; Everytime I use the object afterwards it has the new
name. The second example where the object is complete overwritin doesn't
work I can't understand why.
NOTE: this method resides in the Global.asax.
-------------------
This works...
-----------------
e.Group.Name = "Changed Name";
GroupCollection groups = Application [ "EHIMOnline_Groups" ] as
GroupCollection;
if ( groups != null )
{
Group group = groups.Find ( e.Group.GroupID );
if ( group != null )
{
group.Name = e.Group.Name;
}
}
-------------------------------------
This Doesn't
--------------------------------------
e.Group.Name = "Changed Name";
GroupCollection groups = Application [ "EHIMOnline_Groups" ] as
GroupCollection;
if ( groups != null )
{
Group group = groups.Find ( e.Group.GroupID );
if ( group != null )
{
group = e.Group;
}
}
probably needed a re start with the correct code. I also striped out the
Clone() stuff because that really had no bearing on the problem Im haveing.
My goal is to overwrite the Group object in the collection with the one that
is passed in the method. For some reaseon it doesnt overrite it. But I
tested by just assiging the 'Name' property instead of overwriting he entire
object and it worked; Everytime I use the object afterwards it has the new
name. The second example where the object is complete overwritin doesn't
work I can't understand why.
NOTE: this method resides in the Global.asax.
-------------------
This works...
-----------------
e.Group.Name = "Changed Name";
GroupCollection groups = Application [ "EHIMOnline_Groups" ] as
GroupCollection;
if ( groups != null )
{
Group group = groups.Find ( e.Group.GroupID );
if ( group != null )
{
group.Name = e.Group.Name;
}
}
-------------------------------------
This Doesn't
--------------------------------------
e.Group.Name = "Changed Name";
GroupCollection groups = Application [ "EHIMOnline_Groups" ] as
GroupCollection;
if ( groups != null )
{
Group group = groups.Find ( e.Group.GroupID );
if ( group != null )
{
group = e.Group;
}
}