Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

I switched from .net framework 4 to .net 8. HttpRequestBase' claims it is defined in 'System.Web', but it could not be found

$
0
0

I switched from .net framework 4 to .net 8. I recreated the project. However, it gave errors in many places.

For Request errors in the code: Reference to type 'HttpRequestBase' claims it is defined in 'System.Web', but it could not be found

For RedirectToAction: Reference to type 'RouteValueDictionary' claims it is defined in 'System.Web', but it could not be found

If you can help, I would be very happyenter image description here.

    [ValidateInput(false)][HttpPost]public ActionResult Ekle(tbl_Modul Model){    int dil = Utils.dilIDver();    tbl_Modul modul = db.tbl_Modul.FirstOrDefault(d => d.Id == Model.Id);    if (modul != null)    {        for (int i = 0; i < Request.Files.Count; i++)        {            HttpPostedFileBase img = Request.Files[i];            if (img.ContentLength == 0)                continue;            //string newFileName = KarakterIslem.TarayiciUrl(img.FileName.Split('.')[0]) + DateTime.Now.ToString("dd-MM-yy-hh-mm")            //                          +"." + img.FileName.Split('.')[1];            string pathx = Path.Combine(_hostingEnvironment.ContentRootPath, "~/Public/images/");            string path = Path.Combine(pathx, img.FileName);            img.SaveAs(path);            //System.IO.File.Copy(staticOldFile, staticNewFile);            //   ResimIslem.ThumbCreate(BaseImageFile, newFileName, 50, 50);            // System.IO.File.Delete(staticOldFile);            if (Request.Files["IndexBanner"] != null && Request.Files[i].FileName == Request.Files["IndexBanner"].FileName)            {                modul.IndexBanner = img.FileName;            }            else if (Request.Files["DetayBanner"] != null && Request.Files[i].FileName == Request.Files["DetayBanner"].FileName)            {                modul.DetayBanner = img.FileName;            }        }        if (dil > 1)        {            tbl_ModulDil mdil = db.tbl_ModulDil.FirstOrDefault(d => d.ModulId == Model.Id && d.DilId == dil);            if (mdil == null)            {                db.tbl_ModulDil.Add(new tbl_ModulDil { Adi = Model.Adi, DilId = dil, ModulId = modul.Id, Keywords = Model.KeyWords });            }            else            {                mdil.Adi = Model.Adi;                mdil.Keywords = Model.KeyWords;            }        }        else        {            modul.Adi = Model.Adi;        }        modul.GorunsunMu = Model.GorunsunMu;        modul.IkonChar = Model.IkonChar;        modul.KeyWords = Model.KeyWords;        modul.Limit = Model.Limit;        modul.Sira = Model.Sira;        modul.Url = Model.Url;        modul.ListeTur = Model.ListeTur;        TempData["Status"] = Utils.MessageType.Successful;        TempData["StatusMessage"] = "Modul Güncellendi";    }    else    {        db.tbl_Modul.Add(Model);        TempData["Status"] = Utils.MessageType.Error;        TempData["StatusMessage"] = "Yeni Modül Eklendi. Şimdi Modülün Özelliklerini Ekleyin. (Zorunludur)";    }    db.SaveChanges();    Utils.Cachele();    return RedirectToAction("Index", "Modul");}

Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>