Пример #1
0
        protected void btnEdit_click(object sender, EventArgs e)
        {
            this.ModalPopupExtender1.Show();
            using (GridViewRow row = (GridViewRow)((ImageButton)sender).Parent.Parent)
            {
                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       ID = int.Parse(row.Cells[0].Text);
                DataTable dt = mgr.getNews(ID);

                hiddenID.Value   = ID.ToString();
                tileLbl.Text     = dt.Rows[0]["Title"].ToString();
                AbstractLbl.Text = dt.Rows[0]["Abstract"].ToString();
                byte[] byteArray = (byte[])dt.Rows[0]["photo"];
                newsImage.ImageUrl = "data:image;base64," + Convert.ToBase64String(byteArray);

                this.ModalPopupExtender1.Show();
            }
        }