Click here to Skip to main content
15,892,059 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Print address in country specific format Pin
David Mujica2-Jul-09 2:55
David Mujica2-Jul-09 2:55 
AnswerRe: Print address in country specific format Pin
Gulfraz Khan3-Jul-09 4:53
Gulfraz Khan3-Jul-09 4:53 
QuestionIndex was out of range. Must be non-negative and less than the size of the collection. Pin
haleemasher2-Jul-09 0:20
haleemasher2-Jul-09 0:20 
AnswerCrosspost. Ignore. Pin
J4amieC2-Jul-09 0:31
J4amieC2-Jul-09 0:31 
AnswerRe: Index was out of range. Must be non-negative and less than the size of the collection. Pin
padmanabhan N2-Jul-09 1:31
padmanabhan N2-Jul-09 1:31 
AnswerRe: Index was out of range. Must be non-negative and less than the size of the collection. Pin
mrcooll2-Jul-09 1:42
mrcooll2-Jul-09 1:42 
AnswerRe: Index was out of range. Must be non-negative and less than the size of the collection. Pin
Christian Graus2-Jul-09 8:19
protectorChristian Graus2-Jul-09 8:19 
Question"Who is Logged in" module Pin
mrcooll2-Jul-09 0:16
mrcooll2-Jul-09 0:16 
hi all

i want to list all of the logged in users on a page , i did it fine
but i have a problem when the user close the browser i cant remove them from the list,
how can i get use of Session_End in the Global.asax .

this code is in Global.asax

private   Code.BL.Users.SysUserCollection users = new Code.BL.Users.SysUserCollection();
    public  Code.BL.Users.SysUserCollection OnLineUsers
    {
        get { return users; }
        set { users = value; }
    }


this code is in BL

public class SysUserCollection : IList<SysUser>
   {


       List<SysUser> users = new List<SysUser>();

       #region IList<SysUser> Members

       public int IndexOf(SysUser item)
       {
          return users.IndexOf(item);
       }

       public void Insert(int index, SysUser item)
       {
           throw new Exception("The method or operation is not implemented.");
       }

       public void RemoveAt(int index)
       {
           users.RemoveAt(index);
       }

       public SysUser this[int index]
       {
           get
           {
               return users[index];
           }
           set
           {
               users[index] = value;
           }
       }

       #endregion

       #region ICollection<SysUser> Members

       public void Add(SysUser item)
       {
           if (!this.Contains(item))
           {
               users.Add(item);

           }

       }

       public void Clear()
       {
           users.Clear();
       }

       public bool Contains(SysUser item)
       {
           foreach (SysUser user in users)
           {
               if (user.UserId == item.UserId)
                   return true;
           }
           return false;
       }

       public void CopyTo(SysUser[] array, int arrayIndex)
       {
           throw new Exception("The method or operation is not implemented.");
       }

       public int Count
       {
           get { return users.Count; }
       }

       public bool IsReadOnly
       {
           get { throw new Exception("The method or operation is not implemented."); }
       }

       public bool Remove(SysUser item)
       {
           foreach (SysUser user in users)
           {
               if (user.UserId == item.UserId)
               {
                   return users.Remove(user);
               }
           }
        return false;
       }

       #endregion

       #region IEnumerable<SysUser> Members

       public IEnumerator<SysUser> GetEnumerator()
       {
           return users.GetEnumerator();
       }

       #endregion

       #region IEnumerable Members

       IEnumerator IEnumerable.GetEnumerator()
       {
           throw new Exception("The method or operation is not implemented.");
       }

       #endregion
   }


thx
Questioncustom paging Pin
pupilstuff1-Jul-09 23:44
pupilstuff1-Jul-09 23:44 
AnswerRe: custom paging Pin
Abhijit Jana2-Jul-09 0:46
professionalAbhijit Jana2-Jul-09 0:46 
QuestionConvert page template to master page Pin
jchandramouli1-Jul-09 23:43
jchandramouli1-Jul-09 23:43 
AnswerRe: Convert page template to master page Pin
Jeremy Likness2-Jul-09 2:51
professionalJeremy Likness2-Jul-09 2:51 
QuestionIListSource does not contain any data sources [modified] Pin
haleemasher1-Jul-09 22:50
haleemasher1-Jul-09 22:50 
AnswerRe: IListSource does not contain any data sources Pin
Blue_Boy1-Jul-09 23:16
Blue_Boy1-Jul-09 23:16 
GeneralRe: IListSource does not contain any data sources Pin
haleemasher1-Jul-09 23:23
haleemasher1-Jul-09 23:23 
AnswerRe: IListSource does not contain any data sources Pin
Manas Bhardwaj1-Jul-09 23:23
professionalManas Bhardwaj1-Jul-09 23:23 
GeneralRe: IListSource does not contain any data sources Pin
haleemasher1-Jul-09 23:29
haleemasher1-Jul-09 23:29 
GeneralRe: IListSource does not contain any data sources Pin
Manas Bhardwaj1-Jul-09 23:42
professionalManas Bhardwaj1-Jul-09 23:42 
GeneralRe: IListSource does not contain any data sources Pin
haleemasher1-Jul-09 23:49
haleemasher1-Jul-09 23:49 
GeneralRe: IListSource does not contain any data sources Pin
Blue_Boy1-Jul-09 23:56
Blue_Boy1-Jul-09 23:56 
GeneralRe: IListSource does not contain any data sources Pin
haleemasher1-Jul-09 23:59
haleemasher1-Jul-09 23:59 
GeneralRe: IListSource does not contain any data sources Pin
Blue_Boy2-Jul-09 1:11
Blue_Boy2-Jul-09 1:11 
AnswerRe: IListSource does not contain any data sources Pin
r a m e s h2-Jul-09 0:04
r a m e s h2-Jul-09 0:04 
GeneralRe: IListSource does not contain any data sources Pin
haleemasher2-Jul-09 0:09
haleemasher2-Jul-09 0:09 
GeneralRe: IListSource does not contain any data sources Pin
r a m e s h2-Jul-09 1:06
r a m e s h2-Jul-09 1:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.