Skip to content

Instantly share code, notes, and snippets.

Avatar

Renan Carlos Renancp01

  • Goiânia - GO
View GitHub Profile
@Renancp01
Renancp01 / Create.cshtml
Last active Feb 7, 2017
Gist Criado para integração do TinyMCE ASP.NET MVC
View Create.cshtml
@model EuVotoAf.Models.ViewModels.PublicaoViewModel
@{
ViewBag.Title = "Create";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<script src="~/Scripts/tinymce/tinymce.js"></script>
<h2>Create</h2>
View Index.cshtml
@foreach (var item in Model)
{
<section class="container">
<article class="row">
<div class="col-md-4">
<div class="thumbnail">
<h3 style="padding-left:17px;padding:0; background-color:orangered; margin:0; text-align:center;color:white;">@Html.DisplayFor(model => item.Titulo)</h3>
<img src="~/Uploads/Imagens/teste.jpg" class="col-md-12 " style="padding:0;" />
<div>
@Html.DisplayFor(model => item.Resumo);
@Renancp01
Renancp01 / Upload.cs
Created Jan 30, 2017
Upload de imagem TinyMCE
View Upload.cs
public string Upload(HttpPostedFileBase file)
{
string path;
string saveloc = "~/Uploads/Imagens";
string relativeloc = "/Uploads/Imagens/";
string filename = file.FileName;
if (file != null && file.ContentLength > 0 && IsImage(file))
{
try
You can’t perform that action at this time.