Exemple #1
0
        //[ValidateAntiForgeryToken]
        public ActionResult MyPhoto(MyGalleryModel MyLmd)
        {
            string ThePath = "";

            if (Request.Files.Count > 0)
            {
                var file = Request.Files[0];
                if (file != null && file.ContentLength > 0)
                {
                    var fileName = Path.GetFileName(file.FileName);
                    var path     = Path.Combine(Server.MapPath("~/Content/Images/"), fileName);
                    file.SaveAs(path);
                    ViewBag.StatusMessage = "";
                    ThePath = "/Content/Images/" + fileName;
                }
                else
                {
                    ViewBag.StatusMessage = "خطا در عکس انتخابی";
                }
            }
            else
            {
                ViewBag.StatusMessage = "لطفا عکسی را انتخاب نمایید";
            }

            //return RedirectToAction("MyGallery",lmd);
            //return true;
            return(View("Gallery", MyLmd));
            //return MyLmd
        }
Exemple #2
0
        public ActionResult MyGallery()
        {
            MyGalleryModel lmd = new MyGalleryModel();

            return(View(lmd));
        }
Exemple #3
0
 public ActionResult Gallery(MyGalleryModel Lmd)
 {
     return(View(Lmd));
 }