Export to PDF does not work with .net Master Page & Radeditor

4 posts, 0 answers
  1. Bhavika
    Bhavika avatar
    3 posts
    Member since:
    Aug 2011

    Posted 08 Aug 2011 Link to this post

    I have an application, where i have used RadEditor inside a page with uses master page, i have kept a button for export to PDF, the event fires when i click the button , but nothing happens on screen  , but when i remove master page the code works like a charm.

    Below is the aspx code.

    <asp:Button ID="ExportToPDFButton" runat="server" Text="Export to PDF" OnClick="ExportToPDFButton_Click" />
                                <telerik:RadEditor ID="ContentEditor" runat="server" ContentFilters="DefaultFilters,PdfExportFilter"
                                    Width="100%">
                                    <ExportSettings OpenInNewWindow="true" />
                                     
                                    <Content></Content>
                                </telerik:RadEditor >


    Below is the aspx.cs code

    protected void ExportToPDFButton_Click(object sender, EventArgs e)
            {
                ContentEditor.ExportToPdf();
            }

    Does any one have faced the problem?

    Thank You in advance!
  2. Jayesh Goyani
    Jayesh Goyani avatar
    2733 posts
    Member since:
    May 2010

    Posted 08 Aug 2011 Link to this post

    Hello,

    There is not any issue in export to pdf of radeditor with master page.

    Please send some part your code of master page and content page.

    so we will find the issue in your code.

    Thanks,
    Jayesh Goyani
  3. Bhavika
    Bhavika avatar
    3 posts
    Member since:
    Aug 2011

    Posted 08 Aug 2011 Link to this post

    Hi!

    I created a simple application for testing, i just added a master page, a content page,
    i put down the RadEditor & Export to PDF, it doesnt work!
  4. Jayesh Goyani
    Jayesh Goyani avatar
    2733 posts
    Member since:
    May 2010

    Posted 08 Aug 2011 Link to this post

    Hello Bhavika,

    MasterPage2.master
    <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage2.master.cs" Inherits="MasterPage2" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <head runat="server">
        <title></title>
        <asp:ContentPlaceHolder id="head" runat="server">
        </asp:ContentPlaceHolder>
    </head>
    <body>
        <form id="form1" runat="server">
        <telerik:RadScriptManager  ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
        <div>
     
            <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
             
            </asp:ContentPlaceHolder>
        </div>
        </form>
    </body>
    </html>

    MasterPage2.master.cs
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
     
    public partial class MasterPage2 : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
     
        }
    }

    FormDecoder.aspx
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="FormDecoder.aspx.cs" Inherits="FormDecoder"
        MasterPageFile="~/MasterPage2.master" %>
     
    <asp:Content ID="Content1" runat="server" ContentPlaceHolderID="head">
    </asp:Content>
    <asp:Content ID="Content2" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
        <div>
            <asp:Button ID="ExportToPDFButton" runat="server" Text="Export to PDF" OnClick="ExportToPDFButton_Click" />
            <telerik:RadEditor ID="ContentEditor" runat="server" ContentFilters="DefaultFilters,PdfExportFilter"
                Width="100%">
                <ExportSettings OpenInNewWindow="true" />
                <Content></Content>
            </telerik:RadEditor>
        </div>
    </asp:Content>

    FormDecoder.aspx.cs
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
     
    public partial class FormDecoder : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
     
        }
        protected void ExportToPDFButton_Click(object sender, EventArgs e)
        {
            ContentEditor.ExportToPdf();
        }
     
    }


    This is my code please compare this with your code and let me know if any concern.
    i also add export file's screen shot.

    Thanks,
    Jayesh Goyani
Back to Top