Ejemplo n.º 1
0
        //First OnClientCreated Event Handler Called By Default.aspx
        public static void OnClientCreatedToFirst(string ClientId)
        {
            //reading data from session
            object   obj = CometWorker.ReadSessionObject("openingTime");
            DateTime dt  = DateTime.MinValue;

            if (obj != null)
            {
                dt = (DateTime)obj;
            }

            //Do not send a message to the client during its OnClientConnected phase.
            //Instead use this event in order to start sending messages
            CometWorker.SendToClient(ClientId, JSON.Method("s", "OnClientCreatedToFirst event is fired, page loaded at" + dt.ToLongTimeString()));
        }