Hello
cms is nothing lase then database driven application
use advantage of VS and c# and that its easy to create that connections I will use MVC on start
before layout i will create a functionality
for example by creating Models what will specify some of the functionality Banner Logo or some graphic
for Logo i will use something like
public byte[] Logo { get; set; }
[HiddenInput(DisplayValue = true)]
public string logoMimeType { get; set; }
that's example for keeping it in database but u can do it in folder to up to u of corse folder will be better for websites
That will be ur model
the set up a controller
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Edit([Bind(Include = "MyLogoID,Logo,ImageMimeType")]
MyLogo mylogo, HttpPostedFileBase image)
{
if (ModelState.IsValid)
{
if (image != null) {
mylogo.logoMimeType = image.ContentType;
mylogo.Logo = new byte[image.ContentLength];
image.InputStream.Read(mylogo.Logo, 0, image.ContentLength);
}
db.Entry(mylogo).State = EntityState.Modified;
TempData["message"] = string.Format("{0} has beensaved", mylogo.Name);
db.SaveChanges();
return RedirectToAction("Index");
}
return View(Logo);
}
now create something what will pull the logo from database or folder
public FileContentResult GetImage(int mylogoId)
{ MyLogo emp = db.MyLogo.FirstOrDefault(p => p.MyLogoID == mylogoId);
if (emp != null) {
return File(emp.Logo, emp.logoMimeType);
} else {
return null;
}
}
and now we need to get something what will put that all to the view and in place on website
<img width="150" height="150" src="@Url.Action("GetImage", "Mylogo", new { Model.MyLogoID })" />
or u can use HTML helper
I probably miss miss something xD
but u just have one functionality u can add Logo to the web now and store it in database !
hope i dont need to show u how to create form and view to it to upload and use of the controller