TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Riddhi Valecha
442
3.3k
415.1k
Export To Word - Panel and placeholder - IMP
Jun 12 2018 11:09 AM
Dear Team,
I need help in exporting an entire Panel () to word document.
My ASPX Design is -
<
body
>
<
asp:Panel
id
=
"panel2"
runat
=
"server"
width
=
"100%"
>
<
table
width
=
"1024px"
>
<
tr
>
<
td
>
<
asp:Gridview
id
=
"grdData"
runat
=
"server"
>
</asp:GridView
>
td
>
tr
>
<
tr
>
<
td
>
<
asp:Placeholder
id
=
"ph1"
runat
=
"server"
>
</asp:Placeholder
>
td
>
</
tr
>
<
tr
>
<
td
>
<
asp:Gridview
id
=
"grdDataAdmin"
runat
=
"server"
>
</
asp:GridView
>
</
td
>
</
tr
>
</
table
>
</
asp:Panel
>
</body
>
By Button Code -
protected
void
Export(
object
sender, EventArgs e)
{
Response.Clear();
Response.Buffer =
true
;
Response.ContentType =
"application/vnd.word"
;
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.AddHeader(
"Content-Disposition"
,
"attachment;filename=History.doc"
);
Response.Charset =
""
;
EnableViewState =
false
;
Table table =
new
Table();
TableRow row =
new
TableRow();
row.Cells.Add(
new
TableCell());
row.Cells[0].Controls.Add(panel2);
table.Rows.Add(row);
System.IO.StringWriter oStringWriter =
new
System.IO.StringWriter();
System.Web.UI.HtmlTextWriter oHtmlTextWriter =
new
System.Web.UI.HtmlTextWriter(oStringWriter);
table.RenderControl(oHtmlTextWriter);
Response.Write(oStringWriter.ToString());
Response.End();
}
Issue -
I am loading the placeholder on Page Load Event.
Entire Panel is exported , but not the placeholder.
How do I do this?
Please help...as this is a bit urgent...
Reply
Answers (
6
)
modalpopupextender have an element style change .
Error in return view