Posts

Showing posts from August, 2021

Display Image preview on Edit time

Controller Code  public async Task<IActionResult> EditBlog(string Id)         {             DropDownInitialize();             _returnModel = await _blogDetailsServices.GetBlog(Id);             if (_returnModel.IsSuccess)             {                 string path = ((EduWeb.Data.Entity.tblblogdetails)_returnModel.Data).ImagePath; // this Line Represent path coming from database                   int pos = path.LastIndexOf("\\") + 1;                 ViewBag.image = path.Substring(pos, path.Length - pos); // Adding  in View Bag                 return View(_returnModel.Data);             }             else ...