Can you plz help me to find docx.dll file for creating word document in asp.net MVC.
Loading
Can you plz help me to find docx.dll file for creating word document in asp.net MVC.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satya KarkiPosted Oct 16, 2021, 8:15 AM
Rijwan AnsariPosted Oct 16, 2021, 8:09 AM
Kip HackmanPosted Oct 14, 2021, 2:23 PM
DISCLOSURE: I am an employee of the company offering this toolkit.
Here is a step by step HTML5/JS Document Editor tutorial:
Leon DPosted Oct 8, 2021, 1:06 AM
Srinivasan RamamoorthiPosted Oct 4, 2021, 4:15 PM
Sachin SinghPosted Oct 4, 2021, 11:09 AM
There are multiple ways
step 1.
PM> Install-Package DocX
step 2.
public class Document
{
public string txtContent { get; set; }
}
step 3.
public class docController : Controller
{
public ActionResult Index()
{
return View();
}
[HttpPost]
public ActionResult Index(Documentdocument)
{
string fileName = Server.MapPath(@"~\DocXExample.docx");
// Create a document in memory:
var doc = DocX.Create(fileName);
// Insert a paragrpah:
doc.InsertParagraph(document.txtContent);
// Save to the output directory:
doc.Save();
TempData["Message"] = "document created successfully.";
return View();
}
}
step 4.
model MVC_tutorials.Models.Document
@{
ViewBag.Title = "create document in asp.net MVC";
}
create document in asp.net MVC
@using (@Html.BeginForm(null, null, FormMethod.Post, new { enctype = "multipart/form-data" }))
{
if (TempData["Message"] != null)
{
@TempData["Message"]
}
@Html.TextAreaFor(model => model.txtContent, new { Class = "mytextstyle", rows = 5, Style = "width:450px", placeholder = "type your content and save it in adocument." })
}