locked
Convert Word File To html Page using C# RRS feed

  • Question

  • User-1251655565 posted

    i have aprofile Page i want to make this page by upload aword document that contain the data and convert it to html profile page

    How I Convert Word File To html Page in c#?


    Sunday, October 10, 2010 2:45 PM

Answers

  • User-231977777 posted

     Hi

    you can use HttpHandler . Here are an Example  :

    (Handler.ashx file)

    public void ProcessRequest (HttpContext context) {
    
            context. Response.Clear();
            context. Response.Buffer = true;
            context.Response.AddHeader("content-disposition", "attachment;filename=file.html");
            context.Response.Charset = string.Empty;
            context.Response.ContentType = "application/html";
            StreamReader reader = new StreamReader(context.Server.MapPath("aa.txt"));
            context.Response.Output.Write(reader.ReadToEnd());   
           }

    and call this Handler Like this :

    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Handler.ashx">Download</asp:HyperLink>



     Now you can modify this Code to meet you requirements.

     

    Hope this helps

    Ahmed

     

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, October 10, 2010 4:41 PM