protected void dlimage_ItemDataBound(object sender, DataListItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         Label lblid = (Label)e.Item.FindControl("lblid");
         if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
         {
             ASPNetFlashVideo.FlashVideo flsvideo = (ASPNetFlashVideo.FlashVideo)e.Item.FindControl("FlashVideo1");
             Label      lblvideoname = (Label)e.Item.FindControl("lblvideoname");
             HtmlImage  image12      = (HtmlImage)e.Item.FindControl("Image1");
             Label      id           = (Label)e.Item.FindControl("id");
             Label      thumb        = (Label)e.Item.FindControl("Label1");
             HtmlAnchor a            = (HtmlAnchor)e.Item.FindControl("imageLink");
             try
             {
                 flsvideo.VideoURL = "galleryvideo/orgvideo/" + lblvideoname.Text;
             }
             catch { }
             try
             {
                 image12.Src = "galleryimage/Thumbimage/" + thumb.Text;
                 a.HRef      = "galleryimage/orgimage/" + id.Text;
             }
             catch { }
             DataAccess da  = new DataAccess();
             DataSet    ds  = new DataSet();
             string     sql = "select * from tblgallery where intschool=" + Session["SchoolID"] + " and intid=" + lblid.Text + " and intedit=0 order by intid desc";
             ds = da.ExceuteSql(sql);
         }
     }
 }
 protected void dlimage_ItemDataBound(object sender, DataListItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         Label       lblname   = (Label)e.Item.FindControl("lblname");
         TextBox     txtname   = (TextBox)e.Item.FindControl("txtname");
         Label       lbldes    = (Label)e.Item.FindControl("lbldescription");
         TextBox     txtdes    = (TextBox)e.Item.FindControl("txtdescription");
         ImageButton imageedit = (ImageButton)e.Item.FindControl("imageedit");
         Label       lblid     = (Label)e.Item.FindControl("lblid");
         ASPNetFlashVideo.FlashVideo flsvideo = (ASPNetFlashVideo.FlashVideo)e.Item.FindControl("FlashVideo1");
         Label      lblvideoname = (Label)e.Item.FindControl("lblvideoname");
         HtmlImage  image12      = (HtmlImage)e.Item.FindControl("Image1");
         Label      id           = (Label)e.Item.FindControl("id");
         Label      thumb        = (Label)e.Item.FindControl("Label1");
         HtmlAnchor a            = (HtmlAnchor)e.Item.FindControl("imageLink");
         try
         {
             image12.Src       = "galleryimage/Thumbimage/" + thumb.Text;
             a.HRef            = "galleryimage/orgimage/" + id.Text;
             flsvideo.VideoURL = "galleryvideo/orgvideo/" + lblvideoname.Text;
         }
         catch { }
         DataAccess da  = new DataAccess();
         DataSet    ds  = new DataSet();
         string     sql = "select * from tblgallery where intschool=" + Session["SchoolID"] + " and intid=" + lblid.Text + " and intedit=0 order by intid desc";
         ds = da.ExceuteSql(sql);
         if (ds.Tables[0].Rows.Count > 0)
         {
             if (lblname.Text == "")
             {
                 txtname.Visible = true;
                 lblname.Visible = false;
             }
             else
             {
                 txtname.Visible = false;
                 lblname.Visible = true;
             }
             if (lbldes.Text == "")
             {
                 txtdes.Visible = true;
                 lbldes.Visible = false;
             }
             else
             {
                 txtdes.Visible = false;
                 lbldes.Visible = true;
             }
         }
         else
         {
             txtdes.Visible  = false;
             txtname.Visible = false;
         }
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     //Downloader1.FilePath = Request.MapPath("~/video/");
     q  = "select * from video_detail";
     dt = con.fetch_data(q);
     if (dt.Rows.Count != 0)
     {
         for (i = 0; i < dt.Rows.Count; i++)
         {
             ASPNetFlashVideo.FlashVideo fv1 = new ASPNetFlashVideo.FlashVideo();
             fv1.VideoURL         = dt.Rows[i][1].ToString();
             fv1.Height           = 100;
             fv1.Width            = 130;
             fv1.ShowControlPanel = false;
             fv1.AutoPlay         = false;
             Panel1.Controls.Add(fv1);
             LinkButton lbt1 = new LinkButton();
             lbt1.Text        = "Play";
             lbt1.Width       = 130;
             lbt1.ForeColor   = System.Drawing.Color.White;
             lbt1.CssClass    = "linkbutton";
             lbt1.PostBackUrl = "~/adminupdatevideo.aspx?video_path=" + dt.Rows[i][1].ToString();
             Panel1.Controls.Add(lbt1);
             Label lbl1 = new Label();
             lbl1.Text      = "";
             lbl1.Width     = 130;
             lbl1.Height    = 5;
             lbl1.ForeColor = System.Drawing.Color.White;
             Panel1.Controls.Add(lbl1);
             LinkButton lbt2 = new LinkButton();
             lbt2.Text        = "Delete it";
             lbt2.Width       = 130;
             lbt2.ForeColor   = System.Drawing.Color.White;
             lbt2.CssClass    = "linkbutton";
             lbt2.PostBackUrl = "~/admindeletevideo.aspx?video_id=" + dt.Rows[i][0].ToString();
             Panel1.Controls.Add(lbt2);
             Label lbl2 = new Label();
             lbl2.Text      = "";
             lbl2.Width     = 130;
             lbl2.Height    = 20;
             lbl2.ForeColor = System.Drawing.Color.White;
             Panel1.Controls.Add(lbl2);
             Panel1.ScrollBars = System.Web.UI.WebControls.ScrollBars.Auto;
         }
     }
     if (Request["video_path"] != null)
     {
         FlashVideo1.VideoURL = Request["video_path"].ToString();
         //  lbtdownload.Visible = true;
         //  Downloader1.FilePath = Request.MapPath(Request["video_path"].ToString());
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     //Downloader1.FilePath = Request.MapPath("~/video/");
     q = "select * from video_detail";
     dt = con.fetch_data(q);
     if (dt.Rows.Count != 0)
     {
         for (i = 0; i < dt.Rows.Count; i++)
         {
             ASPNetFlashVideo.FlashVideo fv1 = new ASPNetFlashVideo.FlashVideo();
             fv1.VideoURL = dt.Rows[i][1].ToString();
             fv1.Height = 100;
             fv1.Width = 130;
             fv1.ShowControlPanel = false;
             fv1.AutoPlay = false;
             Panel1.Controls.Add(fv1);
             LinkButton lbt1 = new LinkButton();
             lbt1.Text = "Play";
             lbt1.Width = 130;
             lbt1.ForeColor = System.Drawing.Color.White;
             lbt1.CssClass = "linkbutton";
             lbt1.PostBackUrl = "~/adminupdatevideo.aspx?video_path=" + dt.Rows[i][1].ToString();
             Panel1.Controls.Add(lbt1);
             Label lbl1 = new Label();
             lbl1.Text = "";
             lbl1.Width = 130;
             lbl1.Height = 5;
             lbl1.ForeColor = System.Drawing.Color.White;
             Panel1.Controls.Add(lbl1);
             LinkButton lbt2 = new LinkButton();
             lbt2.Text = "Delete it";
             lbt2.Width = 130;
             lbt2.ForeColor = System.Drawing.Color.White;
             lbt2.CssClass = "linkbutton";
             lbt2.PostBackUrl = "~/admindeletevideo.aspx?video_id=" + dt.Rows[i][0].ToString();
             Panel1.Controls.Add(lbt2);
             Label lbl2 = new Label();
             lbl2.Text = "";
             lbl2.Width = 130;
             lbl2.Height = 20;
             lbl2.ForeColor = System.Drawing.Color.White;
             Panel1.Controls.Add(lbl2);
             Panel1.ScrollBars = System.Web.UI.WebControls.ScrollBars.Auto;
         }
     }
     if (Request["video_path"] != null)
     {
         FlashVideo1.VideoURL = Request["video_path"].ToString();
       //  lbtdownload.Visible = true;
       //  Downloader1.FilePath = Request.MapPath(Request["video_path"].ToString());
     }
 }
    public void Item_Bound1(Object sender, DataListItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item ||
            e.Item.ItemType == ListItemType.AlternatingItem)
        {
            // Retrieve the Label control in the current DataListItem.


            // System.Data.DataRowView drv = (System.Data.DataRowView)(e.Item.DataItem);


            Label filename = (Label)e.Item.FindControl("videoname");


            ASPNetFlashVideo.FlashVideo f = (ASPNetFlashVideo.FlashVideo)e.Item.FindControl("FlashVideo3");


            f.VideoURL = "video/" + filename.Text;
        }
    }
Example #6
0
    protected void dlimage_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        try
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Label       lblname   = (Label)e.Item.FindControl("lblname");
                TextBox     txtname   = (TextBox)e.Item.FindControl("txtname");
                Label       lbldes    = (Label)e.Item.FindControl("lbldescription");
                TextBox     txtdes    = (TextBox)e.Item.FindControl("txtdescription");
                ImageButton imageedit = (ImageButton)e.Item.FindControl("imageedit");
                Label       lblid     = (Label)e.Item.FindControl("lblid");
                CheckBox    chkimage  = (CheckBox)e.Item.FindControl("checkimage");
                ASPNetFlashVideo.FlashVideo flsvideo = (ASPNetFlashVideo.FlashVideo)e.Item.FindControl("FlashVideo1");
                Label      lblvideoname = (Label)e.Item.FindControl("lblvideoname");
                HtmlImage  image12      = (HtmlImage)e.Item.FindControl("Image1");
                Label      id           = (Label)e.Item.FindControl("id");
                Label      thumb        = (Label)e.Item.FindControl("Label1");
                HtmlAnchor a            = (HtmlAnchor)e.Item.FindControl("imageLink");
                try
                {
                    flsvideo.VideoURL = "galleryvideo/orgvideo/" + lblvideoname.Text;
                }
                catch { }
                try
                {
                    image12.Src = "galleryimage/Thumbimage/" + thumb.Text;
                    a.HRef      = "galleryimage/orgimage/" + id.Text;
                }
                catch { }

                DataAccess da  = new DataAccess();
                DataSet    ds  = new DataSet();
                string     sql = "select * from tblgallery where intschool=" + Session["SchoolID"];
                sql += " and intid=" + lblid.Text + "";
                if (radiophoto.Checked == true)
                {
                    sql += " and strcategory='Photos'";
                }
                else
                {
                    sql += " and strcategory='Videos'";
                }
                sql += " and intedit=0 order by intid desc";
                ds   = da.ExceuteSql(sql);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (radiophoto.Checked == true)
                    {
                        //HtmlInputButton tag = (HtmlInputButton)e.Item.FindControl("tag");
                        //HtmlInputButton crop = (HtmlInputButton)e.Item.FindControl("crop");
                        HtmlControl crop = (HtmlControl)e.Item.FindControl("crop");
                        //Button crop = (Button)e.Item.FindControl("crop");
                        //tag.Visible = true;
                        crop.Visible = true;
                    }
                    chkimage.Visible  = true;
                    imageedit.Visible = true;
                    if (lblname.Text == "")
                    {
                        txtname.Visible = true;
                        lblname.Visible = false;
                    }
                    else
                    {
                        txtname.Visible = false;
                        lblname.Visible = true;
                    }
                    if (lbldes.Text == "")
                    {
                        txtdes.Visible = true;
                        lbldes.Visible = false;
                    }
                    else
                    {
                        txtdes.Visible = false;
                        lbldes.Visible = true;
                    }
                }
                else
                {
                    if (radiophoto.Checked == true)
                    {
                        //HtmlInputButton tag = (HtmlInputButton)e.Item.FindControl("tag");
                        // HtmlInputButton crop = (HtmlInputButton)e.Item.FindControl("crop");
                        //Button crop = (Button)e.Item.FindControl("crop");
                        HtmlControl crop = (HtmlControl)e.Item.FindControl("crop");
                        //tag.Visible = false;
                        crop.Visible = false;
                    }
                    chkimage.Visible  = false;
                    imageedit.Visible = false;
                    txtdes.Visible    = false;
                    txtname.Visible   = false;
                }
                if (lblname.Text != "" && lbldes.Text != "")
                {
                    imageedit.ImageUrl = "~/media/images/edit.gif";
                    imageedit.ToolTip  = "Edit name and description";
                }
                else
                {
                    imageedit.ImageUrl = "~/media/images/Update.gif";
                    imageedit.ToolTip  = "Update name and description";
                }
            }
        }
        catch { }
    }