Пример #1
0
        protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            HttpChannel chnl = new HttpChannel();

            try
            {
                ChannelServices.RegisterChannel(chnl, false);
                Console.WriteLine("{0}:{1}:{2}:{3}", DateTime.Now.Hour.ToString(),
                                  DateTime.Now.Minute.ToString(), DateTime.Now.Second.ToString(), DateTime.Now.Millisecond.ToString());
                Console.WriteLine("Client.Main : Channel is created and registered");
            }
            catch (RemotingException ex)
            {
                //all good, nobody cares, but we log it
            }

            mgr = (INewsManager)Activator.GetObject(typeof(INewsManager), "http://localhost:1234/NewsManager.soap");
            Console.WriteLine("{0}:{1}:{2}:{3}", DateTime.Now.Hour.ToString(),
                              DateTime.Now.Minute.ToString(), DateTime.Now.Second.ToString(), DateTime.Now.Millisecond.ToString());
            Console.WriteLine("Client.Main : Proxy is created");

            GridView1.PageIndex = e.NewPageIndex;
            int agencyID = int.Parse(Agencies.SelectedValue);

            GridView1.DataSource = mgr.getAgencyNews(agencyID);
            GridView1.DataBind();
        }
Пример #2
0
        protected void Agencies_Change(object sender, EventArgs e)
        {
            HttpChannel chnl = new HttpChannel();

            try
            {
                ChannelServices.RegisterChannel(chnl, false);
            }
            catch (RemotingException ex)
            {
                //all good, nobody cares, but we log it
            }

            mgr = (INewsManager)Activator.GetObject(typeof(INewsManager), "http://localhost:1234/NewsManager.soap");

            int agencyID = int.Parse(Agencies.SelectedValue);

            GridView1.DataSource = mgr.getAgencyNews(agencyID);
            GridView1.DataBind();
        }